Repository navigation
ci: bump golangci-lint to v2.14.0 - #262
Conversation
Lint fails on every pull request since the `stable` Go of setup-go
moved from 1.27.1 to 1.27.2. golangci-lint v2.13.2 cannot read the
export data Go 1.27.2 writes for the standard library ("export data
version 5 is greater than maximum supported version 4"), so typecheck
fails on the first import of testing or bytes. v2.14.0 reads it.
v2.14.0 also adds the modernize stringscut check, which flags the one
strings.LastIndex in the image tag parser; it now uses strings.CutLast.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
IvanHunters
left a comment
There was a problem hiding this comment.
LGTM.
Verified strings.CutLast (added in Go 1.27.0, available under the module's go 1.27.1) is behavior-preserving here: after equals the previous image[lastSlash+1:], and the not-found branch leaves tail = image exactly as lastSlash == -1 did. Walked the cases (no slash, registry-with-port, digest pins rejected earlier, trailing colon) and the result matches the old code. The modernize stringscut rewrite is a pure simplification.
Root cause of the red lint is correct and this is a real fix, not a workaround: setup-go stable moved to Go 1.27.2 (export data v5) and golangci-lint v2.13.2 only reads up to v4; v2.14.0 reads v5. Bumping the linter targets the actual incompatibility.
Live CI on the PR head is green for lint and test on both ubuntu and windows. The only red check is FOSSA License Compliance, which is pinned to the main branch and concerns dependency licenses; this PR changes no dependencies, so it is pre-existing and unrelated.
Lint is red on every pull request right now, main included. setup-go's
stablemoved from Go 1.27.1 to 1.27.2, and golangci-lint v2.13.2 can't read the export data Go 1.27.2 writes for the standard library:I reproduced it with the v2.13.2 release binary under Go 1.27.2 on a clean main. The v2.14.0 release binary reads it and reports 0 issues, on Linux and with GOOS=windows.
The new version also adds the modernize
stringscutcheck. It flags onestrings.LastIndexin the image tag parser inpkg/commands/preflight_upgrade_verify.go, which now usesstrings.CutLast. Behaviour is the same, and the existing parser tests pass.Closes #236
Summary by CodeRabbit