Rewrite Dockerfile optimizer for v1 - #1
Merged
Conversation
davidgrldo
marked this pull request as ready for review
July 16, 2026 10:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
--fail-onwith stable0/1/2exit semantics for CIpflagand the legacy parser packageWhy
The previous implementation treated Dockerfiles as raw strings. Comments, instruction casing, continuations, heredocs, and multi-stage builds could therefore create false positives or hide real findings. Severity was presentation-only, JSON output was incidental, and the repository workflow analyzed a root Dockerfile that did not exist.
This change gives parsing, analysis, reporting, and CI explicit contracts suitable for a v1 release.
Impact
schema_version: "1".--fail-onreturn exit1; operational and parse failures return2.Validation
gofmtcleango vet ./...go test ./... -count=1go test -race ./... -count=1go build ./cmd/dockopt0, finding1, malformed/unterminated2Follow-up
--no-dev;.