Add Go lint/vuln tooling and CI checks#5
Conversation
Add golangci-lint v2 configuration and make targets for lint/vuln. Integrate lint+govulncheck into CI and add tools to Nix devshell. Also bump Go toolchain to 1.25.7 and address revive lint requirements. --- _Generated with [`mux`](https://github.com/coder/mux) • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh`_
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 446a113fd9
ℹ️ 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".
Pin new CI action references by commit SHA, disable checkout credential persistence in lint job, and add a missing package comment required by revive. --- _Generated with [`mux`](https://github.com/coder/mux) • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh`_
Address review feedback by enforcing formatter checks via golangci-lint fmt --diff in both Makefile lint target and CI lint job. --- _Generated with [`mux`](https://github.com/coder/mux) • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh`_
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e16898d1dc
ℹ️ 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".
Address Codex review feedback by requiring the publish-main job to wait for lint, test, and lint-actions jobs. This prevents publishing main images when lint or vulnerability checks fail. --- _Generated with [`mux`](https://github.com/coder/mux) • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh`_
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Summary
.golangci.ymlbaseline using golangci-lint v2 configmake lintandmake vulntargets with binary presence checkslintjob running golangci-lint and govulncheck on pull requestsgolangci-lintandgovulncheckto the Nix devshell package setValidation
nix develop -c golangci-lint versionnix develop -c govulncheck -versionmake lintmake vulnGOFLAGS=-mod=vendor go test ./...GOFLAGS=-mod=vendor go build ./...📋 Implementation Plan
Plan: Add Go linting, vulnerability scanning, CI integration, and devshell tools
Context / Why
This repository is currently a minimal Go skeleton with CI for vendoring, tests, and build, but no linting or vulnerability scanning. The goal is to add a pragmatic, high-signal lint/vuln baseline that:
maketargets,This gives fast feedback early, keeps code quality consistent as the project grows, and preserves the repo’s existing vendoring conventions.
Evidence
2dddbb994bconfirmed:Makefilehasvendor/test/build/verify-vendor/codegenonly..github/workflows/ci.yamlhas onetestjob and vendor verification.flake.nixdevshell includesgo,gnumake,git,goreleaser..golangci.ymland anygovulncheckusage are absent.8ffb06210evalidated:golangci/golangci-lint-action@v9is current/recommended.golang/govulncheck-action@v1is valid/current major.golangci-lintv2.x supports planned config keys.pkgs.golangci-lintandpkgs.govulncheckare expected in nixpkgs unstable.https://github.com/golangci/golangci-lint-actionhttps://github.com/golang/govulncheck-actionImplementation details
1) Add root
.golangci.ymlwith a strict, low-noise baselineCreate
.golangci.ymlusing golangci-lint v2 schema and enforce vendor mode to align with repo conventions.Notes:
2) Extend
Makefilewith fail-fast lint/vuln targetsUpdate
.PHONYand add targets that assert required binaries exist before execution.Why this shape:
GOFLAGS=$(GOFLAGS)preserves current-mod=vendorbehavior.3) Integrate lint + vuln checks into
.github/workflows/ci.yamlAdd a dedicated
lintjob (parallel withtest) per golangci action guidance.Implementation notes:
testjob logic intact; no behavioral regression for current checks.4) Add linter/vuln binaries to
flake.nixdevshellExtend the
packageslist in the default shell.This guarantees local parity with CI and avoids ad-hoc installs.
Validation plan
After implementation, run:
nix develop -c golangci-lint versionnix develop -c govulncheck -versionmake lintmake vulngo test ./...go build ./...And ensure CI workflow syntax/behavior by opening a PR and confirming both
lintandtestjobs execute successfully.Generated with `mux` • Model:
openai:gpt-5.3-codex• Thinking:xhigh