ci: enable err113, gosec, godot, perfsprint, lll linters#346
Merged
bfabio merged 1 commit intoitalia:mainfrom Mar 26, 2026
Merged
ci: enable err113, gosec, godot, perfsprint, lll linters#346bfabio merged 1 commit intoitalia:mainfrom
bfabio merged 1 commit intoitalia:mainfrom
Conversation
ef20984 to
2351c1d
Compare
Member
|
Please fix the linting errors |
Also wrap external errors with %w for wrapcheck, and suppress recvcheck on URL.String (value receiver required for fmt.Stringer).
2351c1d to
223246f
Compare
bfabio
approved these changes
Mar 26, 2026
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.
Enables 5 linters from the planned phase 2 rollout (quick wins, < 30 lines changed).
err113: define a package-level sentinel for the static
"missing URL scheme"message; change%vto%wwhere an underlying error is wrapped; add//nolint:err113for messages that carry dynamic context (URL, size, HTTP status) and have no underlying error to wrap.gosec: G404 (math/rand used to pick from a pre-configured auth list, not security-sensitive); G703 (path traversal false positives on
file://URLs already validated by the parser).godot: add trailing periods to three doc comments in
parser.go,v0.go,v1.go, andvalidations.go.perfsprint: replace two
fmt.Sprintf("%s: ", key)with string concatenation inerrors.go.lll: add a config-level exclusion rule for struct field tag lines (covers all long lines in
v0.go/v1.go); split longValidationWarningliterals infields.goacross multiple lines; add//nolint:lllfor lines containing long URLs or a regex literal that cannot be shortened without losing meaning; split CLI flag help strings inpubliccode-parser/using string concatenation.