Symptom
A CodeRabbit review on ptr727/ESPHome-Config#115
(a hub resync carrying GOVERNANCE.md's "Running the Linters Locally" section, hub commit
3258284) flagged that its documented docker_lint.py invocation,
python3 /path/to/ProjectTemplate/scripts/docker_lint.py --root "$PWD", mounts the live checkout
straight into each lint container.
Root cause
docker_mount() in scripts/docker_lint.py binds the --root path as-is
(type=bind,"src={root}",dst={destination},readonly); it never builds a sanitized snapshot or
excludes git-ignored paths. Read-only stops the container from writing back, not from reading
whatever real files sit in the working tree.
Why this matters
ESPHome-Config's OPERATIONS.md already documents this exact hazard for third-party lint
containers generally, from a real past incident (secrets.yaml holding live device credentials,
git-ignored but present on disk): the fix there is to snapshot tracked-plus-intended-untracked
files into a temp dir first (git ls-files --cached --others --exclude-standard), then mount
that. docker_lint.py --root "$PWD" bypasses that protection when run literally as the hub's own
docs show it, in any repo that keeps a real secret file on disk alongside a tracked placeholder
(this pattern is not unique to ESPHome-Config).
Suggested fix
Either have docker_lint.py build its own tracked-plus-untracked-unignored snapshot before
mounting (consistent with how it already discovers lint targets via git ls-files/unignored
files elsewhere in the script), or add a documented --root caveat next to the invocation in
GOVERNANCE.md "Running the Linters Locally" pointing at the same snapshot pattern, so a repo
carrying that section verbatim doesn't have to know to add its own caveat.
Workaround applied downstream
ESPHome-Config#115 extends its own OPERATIONS.md "Repository Tooling Hazards" bullet to say
docker_lint.py --root must be the sanitized snapshot path, never the live checkout, since
OPERATIONS.md is this repo's own content and not hub-carried.
Symptom
A CodeRabbit review on ptr727/ESPHome-Config#115
(a hub resync carrying GOVERNANCE.md's "Running the Linters Locally" section, hub commit
3258284) flagged that its documenteddocker_lint.pyinvocation,python3 /path/to/ProjectTemplate/scripts/docker_lint.py --root "$PWD", mounts the live checkoutstraight into each lint container.
Root cause
docker_mount()inscripts/docker_lint.pybinds the--rootpath as-is(
type=bind,"src={root}",dst={destination},readonly); it never builds a sanitized snapshot orexcludes git-ignored paths. Read-only stops the container from writing back, not from reading
whatever real files sit in the working tree.
Why this matters
ESPHome-Config'sOPERATIONS.mdalready documents this exact hazard for third-party lintcontainers generally, from a real past incident (
secrets.yamlholding live device credentials,git-ignored but present on disk): the fix there is to snapshot tracked-plus-intended-untracked
files into a temp dir first (
git ls-files --cached --others --exclude-standard), then mountthat.
docker_lint.py --root "$PWD"bypasses that protection when run literally as the hub's owndocs show it, in any repo that keeps a real secret file on disk alongside a tracked placeholder
(this pattern is not unique to ESPHome-Config).
Suggested fix
Either have
docker_lint.pybuild its own tracked-plus-untracked-unignored snapshot beforemounting (consistent with how it already discovers lint targets via
git ls-files/unignoredfiles elsewhere in the script), or add a documented
--rootcaveat next to the invocation inGOVERNANCE.md "Running the Linters Locally" pointing at the same snapshot pattern, so a repo
carrying that section verbatim doesn't have to know to add its own caveat.
Workaround applied downstream
ESPHome-Config#115 extends its own
OPERATIONS.md"Repository Tooling Hazards" bullet to saydocker_lint.py --rootmust be the sanitized snapshot path, never the live checkout, sinceOPERATIONS.mdis this repo's own content and not hub-carried.