Bump golangci-lint to v2.13.2 so it can read Go 1.27 export data #17
No reviewers
Labels
No labels
⏳in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grey.ooo/someones.computer_tray!17
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/golangci-lint-reads-go-1-27"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Renovate's Go 1.27 bump in the agent repo (run 178, PR #34) turned the
Lintstep red without reporting a single finding:golangci-lint typechecks through whichever
golang.org/x/toolsit was built against, and the pinned v2.6.1 carries v0.38.0 — too old to decode the export data Go 1.27's compiler emits. The linter could not import the standard library, so it linted nothing and exited 1. Nothing was wrong with the code.v2.13.2(x/tools v0.49.0) reads it. Measured on Go 1.27.1:So the pin has a floor as well as the ceiling it was introduced for: a Go bump needs the linter bumped alongside it, or the gate stops running rather than going red.
hack/lint.shnow says so where the pin lives..github/workflows/ci.yamlalso grew a note that itsgo installversion must equalhack/lint.sh'sVERSION— on a mismatch the script ignores the installed binary and falls back to the container, whose-v "$PWD":/appin a job step mounts an empty directory, i.e. a greenLintstep that read no code.Carried across all four Go repos
The pin and
.golangci.yamlare duplicated on purpose and are meant to stay identical, so this lands as the same change in each:someones.computer_agent,someones.computer_scclient,someones.computer_tray,someones.computer_terraform. Both file headers still said "three repos" and did not mention the terraform provider; they name four now.The tail: gosec got stricter too
The newer ruleset flags four sites here, all of them false, each now carrying a
#nosecnaming the rule and why:internal/tray/tray.go—G204onopenBrowser; one directive on theswitchcoveringopen/rundll32/xdg-open. The binary is a literal, the URL is one argv element, and there is no shell to re-split it.internal/tray/notify.go—G204onnotify-send. Same shape; theosascriptbranch beside it already had one.cmd/menudump/main.go—G602(slice index out of range) onargs[0], args[1], which thelen(args) == 2case expression directly above guards. gosec reads the index without the branch that reached it.Older gosec flagged only a variable command name for
G204; the ruleset shipping from v2.12 flags variable arguments too, which is what turned these into findings. Keeping the rule enabled and annotating the legitimate sites, rather than excludingG204wholesale, keeps it live for a futureexeccall that is genuinely unsafe.Verified
./hack/lint.sh→ 0 issues on Go 1.27.1 and on Go 1.26.7 (whatmainbuilds today), so the branch is green before and after a Go bump lands here.go vet ./...clean,go test ./...passes, on Go 1.27.1.shellcheck -x -S warning hack/lint.shclean.actionlintclean apart from the pre-existingactions/upload-artifact@v3"too old" warning, which is a deliberate pin for this Forgejo and untouched here.Follow-up, deliberately out of scope
The platform repo's submodule pins move once these four merge, not before —
make lint-submodule-pinsrequires a pin on the default branch.WIP: Bump golangci-lint to v2.13.2 so it can read Go 1.27 export datato Bump golangci-lint to v2.13.2 so it can read Go 1.27 export data