Repository navigation
fix(deps): patch Go toolchain and x/sys advisories, add lint checks - #15
Merged
Merged
Conversation
govulncheck reported GO-2026-5024 in golang.org/x/sys v0.6.0 (fixed in v0.44.0) and 13 stdlib advisories in go1.25.14 that are fixed only in go1.26.9; the go1.25 line no longer receives fixes. The go directive stays at 1.25.0.
Use a tagged switch in parseArgs, errors.Is in tests, and exec.CommandContext with t.Context() in test helpers.
Add a v2 .golangci.yml, declare the tools in .mise.toml, add lint, lint:fix, vulncheck, deadcode and check mise tasks, run them in a new Lint CI job, and drop the gofmt/go-vet prek hooks that golangci-lint now covers.
mise runs multi-line tasks with sh, which is dash on Ubuntu runners and rejects 'set -o pipefail'.
The module is built and tested only with the go1.26.9 toolchain, and the go1.25 line no longer receives security fixes, so the 1.25.0 minimum was no longer verified.
- List all 23 revive default rules in .golangci.yml: a custom `rules` list enables only the listed rules, so `[exported]` silently dropped the rest of revive's defaults. - Add package doc comments in main.go and internal/git/git.go (package-comments rule, previously masked). - Pin deadcode to major v0 and govulncheck to major v1 in .mise.toml instead of "latest": reproducible CI, minor drift via mise go backend.
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.
Summary
Adds static analysis to the repo:
golangci-lint(v2 config),govulncheckanddeadcode, runnable locally through mise tasks and enforced by a newLintCI job. It also fixes the findings those tools reported, including vulnerable dependency and toolchain versions.Changes
Tooling
.golangci.yml(v2 schema): thestandardlinter set plusbodyclose,copyloopvar,errorlint,gocritic,gosec,misspell,nilerr,noctx,prealloc,revive(exportedrule),unconvert,unparam,usestdlibvarsandwastedassign. Formatters:gofumptandgoimports, with local imports grouped undergithub.com/looztra/gh-sync..mise.toml: declaresgolangci-lint = "2.14"(pinned to a minor so local and CI run the same version),govulncheckanddeadcode.toolbox/mise/tasks/toml/lint.tomlwith these tasks:lint,lint:fix,vulncheck.deadcode, wrapped so it fails when it finds unreachable functions;deadcodeitself always exits 0.check, which runs lint, vulncheck, deadcode and the tests..github/workflows/code-checks.yml: a newLintjob afterPre-committhat runs the lint, vulncheck and deadcode mise tasks, in parallel withTest..pre-commit-config.yaml: removes the localgofmtandgo-vethooks. golangci-lint now covers both (gofumpt/goimportsandgovet).Lint exclusions
Both are limited to
internal/git/git.go. Both linters stay active everywhere else.gosecG204: the binary is always the literal"git", and passing the caller's arguments through is what the wrapper is for.noctx: theinternal/gitAPI has nocontext.Contextparameter yet. Adding one to every exported function is a separate refactor.The
commentsexclusion preset is deliberately left out because it would silently disable thereviveexportedrule.Code fixes
parseArgsuses a taggedswitch.errors.Is, and the test helpers useexec.CommandContext(t.Context(), ...).Dependencies
golang.org/x/sysv0.6.0 → v0.44.0 (GO-2026-5024).toolchaingo1.25.14 → go1.26.9. This fixes 12 stdlib advisories and oneosadvisory that are only patched in go1.26.9; the go1.25 line no longer receives fixes. Release binaries will now be built with Go 1.26.godirective) 1.25.0 → 1.26.0. The module is only built and tested with 1.26, so the declared minimum now matches what is verified. Building from source with a Go 1.25 toolchain andGOTOOLCHAIN=localno longer works.None of these advisories were reachable from the code, according to govulncheck.
Testing instructions
From a checkout of this branch:
mise installmise run check: lint, vulncheck, deadcode and tests all pass.func deadProbe() {}tomain.goand runmise run deadcode. It exits 1 withdeadcode: unreachable functions found. Remove the function.func ExportedProbe() {}tointernal/version/version.goand runmise run lint. revive reports a missing doc comment. Remove the function.mise run precommit:run: all hooks pass without thegofmtandgo-vethooks.BEGIN_COMMIT_OVERRIDE
fix(deps): patch Go toolchain and x/sys advisories, add lint checks
END_COMMIT_OVERRIDE