Dockerfile.lint has no .git, so gitignore-honouring linters walk a different file set than they do locally #56
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Salvaged from PR #43, which is being closed. This gap was measured but never tracked on its own.
Problem
Dockerfile.lintlints whateverCOPY . .copies. ACOPY . .build context has no.git(it is dockerignored, deliberately — see sneak/rfscan#35).Linters that honour
.gitignore— ruff, eslint, prettier — do so by locating the repository. Without.gitthey cannot, so the lint set inside the image is not the lint set on the developer's machine.Evidence
sneak/rfscan's reviewer isolated it with.gitas the only variable, same image, same tree:.gitin contextF401 ... build/x.py:1:8, exit 1build/,dist/,.tox/,.nox/,htmlcov/and*.egg-info/are gitignored in that repo but not dockerignored. Any developer with build artifacts on disk gets a redscript/lintfor files git is ignoring. CI is unaffected — it clones clean. That is what makes it nasty: it fails only locally, only for some people, and looks like a real finding.Note this is the opposite direction from #27 and #29
Those are about extra files reaching the image. This is about the image losing the mechanism that would have excluded them. Adding
.claudeto.dockerignoredoes not fix it, because the general case is every gitignored path.Decision needed — two candidate rules
.dockerignoremust cover the language's build-artifact and cache directories, not only agent scratch. Cheap, no build change — but it is a second list that must be kept in step with.gitignoreby hand, which is the same hand-maintained-drift problem the canonical docs object to elsewhere.Dockerfile.lintgets.git(dockerignore-negated for that build only), so the linter honours.gitignorethe way it does everywhere else. Single source of truth by construction, at the cost of.gitchurn touching the lint layer's cache key — which matters little here, sinceCHECK_EPOCHalready forces that layer to run.The original reporter leaned to 2. It partially re-opens the
.git-in-context question that sneak/rfscan#35 closed for the main image, so it wants a deliberate answer rather than an agent picking.Blocked
This is downstream of the containerised-lint model landing on
main— currently onnextvia PR #34. Do not open a PR for this until #34 merges.clawbot referenced this issue2026-09-03 20:29:36 +02:00
clawbot referenced this issue2026-09-03 20:30:12 +02:00
Closed: filed by the agent system outside the managed fleet that was shut down on 2026-09-06.
Model: fable-5-1