Splits the Dockerfile into a dedicated lint stage using the golangci/golangci-lint image directly, rather than copying the binary into the builder stage.
Changes
Dockerfile
Lint stage (AS lint): Uses the pre-built golangci/golangci-lint image (pinned by sha256) to run make fmt-check and make lint. This is a self-contained stage with its own go mod download and source copy.
Builder stage (AS builder): Runs only make test and the final binary build. No longer needs golangci-lint installed.
Stage dependency: COPY --from=lint /src/go.sum /dev/null forces BuildKit to always execute the lint stage (without this, unused stages are silently skipped).
Both stages touch mfer/mf.pb.go to prevent make from trying to regenerate via protoc.
With BuildKit, the lint and builder stages run in parallel after their shared go mod download layers complete, so lint/formatting failures surface much faster without blocking on test execution.
Makefile
Added lint to the check target prereqs: check: test lint fmt-check (was check: test fmt-check), matching the REPO_POLICIES requirement.
Closes #39
Splits the Dockerfile into a dedicated lint stage using the `golangci/golangci-lint` image directly, rather than copying the binary into the builder stage.
## Changes
### Dockerfile
- **Lint stage** (`AS lint`): Uses the pre-built `golangci/golangci-lint` image (pinned by sha256) to run `make fmt-check` and `make lint`. This is a self-contained stage with its own `go mod download` and source copy.
- **Builder stage** (`AS builder`): Runs only `make test` and the final binary build. No longer needs golangci-lint installed.
- **Stage dependency**: `COPY --from=lint /src/go.sum /dev/null` forces BuildKit to always execute the lint stage (without this, unused stages are silently skipped).
- Both stages touch `mfer/mf.pb.go` to prevent make from trying to regenerate via protoc.
With BuildKit, the lint and builder stages run in parallel after their shared `go mod download` layers complete, so lint/formatting failures surface much faster without blocking on test execution.
### Makefile
- Added `lint` to the `check` target prereqs: `check: test lint fmt-check` (was `check: test fmt-check`), matching the [REPO_POLICIES](https://git.eeqj.de/sneak/prompts/raw/branch/main/prompts/REPO_POLICIES.md) requirement.
Use the golangci/golangci-lint image directly as a lint stage that runs
fmt-check and lint, rather than copying the binary into the builder stage.
BuildKit runs lint and test stages in parallel, so formatting and lint
failures surface much faster.
The COPY --from=lint dependency ensures BuildKit always executes the lint
stage (without it, unused stages are silently skipped).
Also add lint to the Makefile check target prereqs to match REPO_POLICIES
(check: test lint fmt-check).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #39
Splits the Dockerfile into a dedicated lint stage using the
golangci/golangci-lintimage directly, rather than copying the binary into the builder stage.Changes
Dockerfile
AS lint): Uses the pre-builtgolangci/golangci-lintimage (pinned by sha256) to runmake fmt-checkandmake lint. This is a self-contained stage with its owngo mod downloadand source copy.AS builder): Runs onlymake testand the final binary build. No longer needs golangci-lint installed.COPY --from=lint /src/go.sum /dev/nullforces BuildKit to always execute the lint stage (without this, unused stages are silently skipped).mfer/mf.pb.goto prevent make from trying to regenerate via protoc.With BuildKit, the lint and builder stages run in parallel after their shared
go mod downloadlayers complete, so lint/formatting failures surface much faster without blocking on test execution.Makefile
lintto thechecktarget prereqs:check: test lint fmt-check(wascheck: test fmt-check), matching the REPO_POLICIES requirement.