docs: document fail-fast lint stage pattern for Dockerfiles #18

Merged
sneak merged 1 commits from update-dockerfile-lint-stage-docs into main 2026-03-18 03:59:02 +01:00
Collaborator

Documents the multistage Docker build pattern we now use across repos (chat, pixa, etc.) where a separate lint stage runs make fmt-check and make lint independently from the build stage.

Key additions to REPO_POLICIES.md:

  • Full Dockerfile template showing the lint → build → runtime stage pattern
  • Explanation of COPY --from=lint /src/go.sum /dev/null as the BuildKit dependency trick
  • Handling //go:embed placeholders in the lint stage
  • CGO/system library notes for the lint stage
  • Clarification that tests run in the build stage, not the lint stage

Reference implementations: sneak/chat, sneak/pixa.

Documents the multistage Docker build pattern we now use across repos (chat, pixa, etc.) where a separate `lint` stage runs `make fmt-check` and `make lint` independently from the build stage. Key additions to REPO_POLICIES.md: - Full Dockerfile template showing the lint → build → runtime stage pattern - Explanation of `COPY --from=lint /src/go.sum /dev/null` as the BuildKit dependency trick - Handling `//go:embed` placeholders in the lint stage - CGO/system library notes for the lint stage - Clarification that tests run in the build stage, not the lint stage Reference implementations: `sneak/chat`, `sneak/pixa`.
clawbot added 1 commit 2026-03-13 00:44:56 +01:00
docs: document fail-fast lint stage pattern for Dockerfiles
All checks were successful
check / check (push) Successful in 8s
3ec7ecfca8
Adds detailed documentation of the multistage Docker build pattern
where a separate lint stage runs fmt-check and lint before the build
stage begins. Includes the standard Dockerfile template, the BuildKit
dependency trick (COPY --from=lint), go:embed placeholder handling,
and CGO/system library notes.
clawbot self-assigned this 2026-03-15 22:09:47 +01:00
clawbot added the needs-review label 2026-03-16 20:23:03 +01:00
Author
Collaborator

Review: PR #18 — docs: document fail-fast lint stage pattern for Dockerfiles

Policy Divergences

No policy violations found.

All relevant REPO_POLICIES.md rules checked:

  • External references pinned by hash: Template correctly uses @sha256:... placeholders with version/date comments. ✓
  • YAML front matter last_modified: Updated to 2026-03-12, consistent with commit date. ✓
  • Markdown formatting (proseWrap: always, 80-col): Prettier check passes. ✓
  • .golangci.yml not modified. ✓
  • No build artifacts in version control. ✓
  • Feature branch used (update-dockerfile-lint-stage-docs). ✓
  • No linter/CI/test config modified, no assertions weakened. ✓

Requirements Checklist

Requirement Status
Full Dockerfile template showing lint → build → runtime stage pattern Met
Explanation of COPY --from=lint /src/go.sum /dev/null as BuildKit dependency trick Met
Handling //go:embed placeholders in the lint stage Met
CGO/system library notes for the lint stage Met
Clarification that tests run in the build stage, not the lint stage Met

Build Result

  • make check: PASS (prettier formatting check passes, no test failures)
  • docker build .: PASS (clean build)
  • Rebase onto main: Already up to date, build still passes post-rebase.

Content Accuracy

  • The Dockerfile template correctly demonstrates the three-stage pattern (lint → build → runtime).
  • The COPY --from=lint /src/go.sum /dev/null explanation is technically accurate — this creates a BuildKit stage dependency forcing lint completion before build proceeds.
  • The //go:embed placeholder guidance is practical and correct.
  • The lint stage uses golangci/golangci-lint image directly (includes Go + linter), correctly noted.
  • Tests in build stage rationale (may need compiled artifacts/heavier deps) is sound.
  • Template image references use @sha256:... with version/date comments above, consistent with the pinning policy.

Scope

Single file changed (prompts/REPO_POLICIES.md), single commit, documentation only. No scope creep.

Verdict: PASS

Clean documentation addition. All requirements met, no policy violations, build passes, formatting correct. The new section integrates naturally between the existing Dockerfile and CI workflow bullets.

## Review: [PR #18](https://git.eeqj.de/sneak/prompts/pulls/18) — docs: document fail-fast lint stage pattern for Dockerfiles ### Policy Divergences No policy violations found. All relevant REPO_POLICIES.md rules checked: - External references pinned by hash: Template correctly uses `@sha256:...` placeholders with version/date comments. ✓ - YAML front matter `last_modified`: Updated to `2026-03-12`, consistent with commit date. ✓ - Markdown formatting (proseWrap: always, 80-col): Prettier check passes. ✓ - `.golangci.yml` not modified. ✓ - No build artifacts in version control. ✓ - Feature branch used (`update-dockerfile-lint-stage-docs`). ✓ - No linter/CI/test config modified, no assertions weakened. ✓ ### Requirements Checklist | Requirement | Status | |---|---| | Full Dockerfile template showing lint → build → runtime stage pattern | ✅ Met | | Explanation of `COPY --from=lint /src/go.sum /dev/null` as BuildKit dependency trick | ✅ Met | | Handling `//go:embed` placeholders in the lint stage | ✅ Met | | CGO/system library notes for the lint stage | ✅ Met | | Clarification that tests run in the build stage, not the lint stage | ✅ Met | ### Build Result - `make check`: ✅ PASS (prettier formatting check passes, no test failures) - `docker build .`: ✅ PASS (clean build) - Rebase onto `main`: Already up to date, build still passes post-rebase. ### Content Accuracy - The Dockerfile template correctly demonstrates the three-stage pattern (lint → build → runtime). - The `COPY --from=lint /src/go.sum /dev/null` explanation is technically accurate — this creates a BuildKit stage dependency forcing lint completion before build proceeds. - The `//go:embed` placeholder guidance is practical and correct. - The lint stage uses `golangci/golangci-lint` image directly (includes Go + linter), correctly noted. - Tests in build stage rationale (may need compiled artifacts/heavier deps) is sound. - Template image references use `@sha256:...` with version/date comments above, consistent with the pinning policy. ### Scope Single file changed (`prompts/REPO_POLICIES.md`), single commit, documentation only. No scope creep. ### Verdict: **PASS** Clean documentation addition. All requirements met, no policy violations, build passes, formatting correct. The new section integrates naturally between the existing Dockerfile and CI workflow bullets.
clawbot added merge-ready and removed needs-review labels 2026-03-17 10:30:13 +01:00
clawbot removed their assignment 2026-03-17 10:30:23 +01:00
sneak was assigned by clawbot 2026-03-17 10:30:23 +01:00
sneak merged commit 1c84344978 into main 2026-03-18 03:59:02 +01:00
sneak deleted branch update-dockerfile-lint-stage-docs 2026-03-18 03:59:02 +01:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/prompts#18