Files
kevinveenbirkenbachandClaude Opus 5 5137465c6f style: delete every comment the comments-valid policy rejects
3529 invalid comments in 528 files, grandfathered in while the linter
only saw the working-tree diff. Removal ran through the linter's own
collectors, so detection and deletion cannot drift: a comment whose
opener line is blank before it and whose closer line is blank after it
loses all its lines, anything else loses only the comment region, and a
line left holding a bare delimiter goes with it.

Five files keep their comments behind a nocheck marker instead. Four are
upstream configs whose inline docs are upstream's own (mautrix, systemd
journald, nextcloud-oidc-login, MediaWiki). In littlejs the
commented-out entries ARE the deactivation mechanism for an example
tile, so deleting them would delete configuration.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-18 03:22:02 +02:00

79 lines
2.1 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# Open an interactive shell in the running infinito container, or execute a
# one-off command inside it when cmd or positional arguments are set.
#
# Usage:
# scripts/tests/deploy/local/exec/container.sh [command...] # nocheck: self-path-reference
#
# Environment:
# INFINITO_DISTRO arch|debian|ubuntu|fedora|centos
# INFINITO_CONTAINER Optional explicit container name
# cmd One-off shell command to run instead of an interactive shell
#
# Examples:
# scripts/tests/deploy/local/exec/container.sh whoami # nocheck: self-path-reference
# cmd='whoami && id' scripts/tests/deploy/local/exec/container.sh # nocheck: self-path-reference
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "${SCRIPT_DIR}/../../../../../" && pwd)"
usage() {
cat <<EOF
Usage:
${0}
${0} [command...]
Environment:
INFINITO_DISTRO arch|debian|ubuntu|fedora|centos
INFINITO_CONTAINER Optional explicit container name
cmd One-off shell command to run instead of an interactive shell
Examples:
${0}
${0} whoami
cmd='whoami && id' ${0}
EOF
}
if [[ "${1:-}" == "-h" || "${1:-}" == "--help" ]]; then
usage
exit 0
fi
cd "${REPO_ROOT}"
if [[ -f "scripts/meta/env/load.sh" ]]; then
# shellcheck source=scripts/meta/env/load.sh
source "scripts/meta/env/load.sh"
else
echo "ERROR: missing scripts/meta/env/load.sh" >&2
exit 2
fi
: "${INFINITO_CONTAINER:?INFINITO_CONTAINER not set after sourcing scripts/meta/env/load.sh — bug in defaults.sh?}"
container="${INFINITO_CONTAINER}"
docker_exec_flags=(-i)
if [[ -t 0 && -t 1 ]]; then
docker_exec_flags=(-it)
fi
if [[ $# -gt 0 ]]; then
if [[ "${1:-}" == "--" ]]; then
shift
fi
if [[ $# -eq 0 ]]; then
usage
exit 2
fi
exec docker exec "${docker_exec_flags[@]}" -w "${INFINITO_SRC_DIR}" "${container}" "$@"
fi
if [[ -n "${cmd:-}" ]]; then
exec docker exec "${docker_exec_flags[@]}" -w "${INFINITO_SRC_DIR}" "${container}" sh -lc "${cmd}"
fi
exec docker exec "${docker_exec_flags[@]}" -w "${INFINITO_SRC_DIR}" "${container}" sh