Skip to content

Fixes from the v0.1.0 review, for v0.1.1 - #11

Merged
devblac merged 13 commits into
mainfrom
fix/v0.1.1
Oct 31, 2026
Merged

devblac merged 13 commits into
mainfrom
fix/v0.1.1

Conversation

@devblac

@devblac devblac commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Fixes found by reviewing the v0.1.0 draft before publishing. v0.1.0 stays tagged but unpublished (the Go module proxy cached it), and the first public release will be v0.1.1.

  • The action installs the release matching its own tag by default, so pinning @v0.1.1 pins the linter.
  • Directory searches skip Dockerfile.template/.j2/.bak and similar; exclude is relative to the config file.
  • Flags are accepted after paths; - reads stdin.
  • DKL203 now catches COPY . . before npm ci/pip install -r/go mod download and knows many more installers. Corpus: +2 findings, both true positives.
  • DKL304/DKL305 no longer flag ADD --checksum or Git sources; DKL201 honors PIP_NO_CACHE_DIR; DKL405 ignores manifest-only wildcards.
  • A test checks that every rule reports a real example of its problem (verified with a mutation), plus a CRLF regression test.
  • Docs, go vet in CI, CHANGELOG versioned as 0.1.1.

Merge #10 too (release notes fix) before tagging v0.1.1.

🤖 Generated with Claude Code

devblac and others added 12 commits October 24, 2026 21:15
With version defaulting to latest, pinning uses: devblac/docker-lint@v0.1.0
still installed whatever release was newest, so a later breaking release
would run under an older action script. Default to the action's own tag,
read from github.action_ref or the checkout path, and fall back to the
latest release only for branches and commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ve to the config

A Dockerfile.template, .j2 or .bak in a repository made "docker-lint ."
exit 2 on a file Docker never builds. Directory searches now skip
template, backup and documentation extensions; naming a file still
lints it.

Exclude patterns matched the path as typed, so running from a
subdirectory or with an absolute path ignored them. They are now
matched relative to the configuration file's directory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Go's flag package stops at the first non-flag argument, so the common
"docker-lint Dockerfile --json" treated --json as a missing file. Parse
flags wherever they appear, keep "--" as the end of flags, and read
stdin for a lone "-".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pendencies

DKL203 only fired when another COPY followed the install, and only knew
npm install, yarn install, go mod download and system/pip installs, so
the textbook "COPY . ." then "npm ci" (or pip install -r, go mod
download) went unreported. Copying the whole context before any
dependency install is now always reported, and the install detection
covers npm ci, pnpm, bun, yarn, uv, poetry, pipenv, bundle, composer,
cargo fetch, dotnet restore, mvn dependency:go-offline and more.

On the corpus this adds two findings, both true positives, and no
others.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DKL304 reported ADD --checksum, which is how Docker now recommends
fetching remote files, and ADD of a Git repository at a ref. DKL305 said
COPY would suffice for a git@ repository, which COPY cannot fetch. ADD
now records --checksum, and Git sources count as remote.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The corpus guards against false positives but not against a rule that
never fires, which is how DKL203 went unnoticed. Each rule now has
Dockerfiles it must report, run through the parser and analyzer, and a
rule without such a case fails the test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Setting PIP_NO_CACHE_DIR with ENV, or for the command itself, disables
pip's cache, yet DKL201 still asked for --no-cache-dir. Any non-empty
value counts, matching pip, and an ENV only applies to its own stage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Git for Windows checks files out with CRLF by default. Pin that
continuations, inline ignores, ENV pairs and heredocs behave the same,
with no stray carriage returns in the parsed values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…puts

The feature list still described only flags, inline comments and JSON.
List the action's github-token input and its outputs, run go vet in CI,
and note in the release steps that go install pins a tag in the module
proxy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v0.1.0 was tagged but never published, and the Go module proxy has
cached the tag, so the first release is 0.1.1. Record why, and what
changed since the v0.1.0 tag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ests

COPY package*.json ./ is the pattern DKL203 recommends, yet DKL405
reported it. Wildcards matching manifests only no longer count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-25T00:29:55.687388Z 06c8a50 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 06c8a505ad

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/rules/layer.go
Comment on lines +311 to +315
switch {
case copiesWholeContext(cp.sources):
// Any source change invalidates the install layer: the
// classic "COPY . ." before "npm ci".
flagged[cp.instr.Line()] = true

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exempt installs that consume the copied project source

For a Dockerfile containing COPY . . followed by RUN pip install --no-cache-dir ., this branch now reports DKL203 even though the installation needs the copied source. The existing runReferencesCopy check cannot recognize that dependency because it deliberately ignores .. As confirmed by pip install --help (pip install [options] [-e] <local project path>), this is a local project installation, not merely dependency installation; moving the source copy after it or copying only manifests can break the build or omit the application. Exempt source-consuming installs before issuing the whole-context warning.

Useful? React with 👍 / 👎.

Comment thread internal/rules/layer.go
Comment on lines +36 to +37
// pipNoCacheEnvPattern matches PIP_NO_CACHE_DIR set for the command itself
pipNoCacheEnvPattern = regexp.MustCompile(`\bPIP_NO_CACHE_DIR=\S`)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Scope the cache environment assignment to the pip command

For RUN PIP_NO_CACHE_DIR=1 echo ready && pip install flask, the new regex suppresses DKL201 even though the assignment applies only to echo; pip still runs with caching enabled. It also treats PIP_NO_CACHE_DIR="" pip install flask as disabling caching because the quote satisfies \S, despite the effective value being empty. Match an effective nonempty assignment applying to the pip invocation rather than any textual occurrence anywhere in the RUN command.

Useful? React with 👍 / 👎.

base := filepath.Base(source)
for _, wc := range wildcardChars {
if strings.Contains(base, wc) {
if strings.Contains(base, wc) && !isPackageFile(source) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restrict wildcard exemptions to manifest-only patterns

For COPY *.json /app/, this new condition suppresses DKL405 because isPackageFile("*.json") returns true: it matches a known manifest and none of the helper's six non-manifest probes. However, that wildcard also copies arbitrary JSON files, such as application data and configuration, so it is not a manifest-only selection. Reusing this heuristic removes the existing warning for broad patterns such as *.json and *.toml; use a conservative manifest-pattern whitelist or otherwise ensure broad extension globs remain reportable.

Useful? React with 👍 / 👎.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@devblac
devblac merged commit 816eedc into main Oct 31, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant