Skip to content

ci: enable err113, gosec, godot, perfsprint, lll linters#346

Merged
bfabio merged 1 commit intoitalia:mainfrom
creed-bratton:enable-linters-phase2
Mar 26, 2026
Merged

ci: enable err113, gosec, godot, perfsprint, lll linters#346
bfabio merged 1 commit intoitalia:mainfrom
creed-bratton:enable-linters-phase2

Conversation

@creed-bratton
Copy link
Copy Markdown
Contributor

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 %v to %w where an underlying error is wrapped; add //nolint:err113 for 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, and validations.go.

perfsprint: replace two fmt.Sprintf("%s: ", key) with string concatenation in errors.go.

lll: add a config-level exclusion rule for struct field tag lines (covers all long lines in v0.go/v1.go); split long ValidationWarning literals in fields.go across multiple lines; add //nolint:lll for lines containing long URLs or a regex literal that cannot be shortened without losing meaning; split CLI flag help strings in publiccode-parser/ using string concatenation.

@creed-bratton creed-bratton force-pushed the enable-linters-phase2 branch 2 times, most recently from ef20984 to 2351c1d Compare March 25, 2026 12:47
@bfabio
Copy link
Copy Markdown
Member

bfabio commented Mar 25, 2026

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).
@creed-bratton creed-bratton force-pushed the enable-linters-phase2 branch from 2351c1d to 223246f Compare March 26, 2026 06:37
@bfabio bfabio merged commit bb54c2e into italia:main Mar 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants