Skip to content

ci: enable godox, noctx, errname, ireturn linters#345

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

ci: enable godox, noctx, errname, ireturn linters#345
bfabio merged 1 commit intoitalia:mainfrom
creed-bratton:enable-linters-phase1

Conversation

@creed-bratton
Copy link
Copy Markdown
Contributor

Enables four linters that have zero violations in the current codebase.

godox — no TODO/FIXME/HACK/XXX in production code.

noctx — no direct http.Get/http.Post calls; the codebase uses a custom HTTP client throughout.

ireturn — no bare interface returns. MarshalYAML() (any, error) is covered by the default empty allow category.

errname — error types follow the convention. ValidationWarning is the only exception: it is intentionally named as a warning even though it implements error (it signals a non-fatal issue, not an error). A //nolint:errname annotation documents this.

recvcheck, errorlint, err113, wrapcheck will be addressed separately as they need small code fixes.

@creed-bratton creed-bratton force-pushed the enable-linters-phase1 branch from d5bce49 to 490b035 Compare March 24, 2026 18:46
@bfabio
Copy link
Copy Markdown
Member

bfabio commented Mar 25, 2026

@creed-bratton I'm not onboard with the godox rule.

Banning TODO and FIXME outright is harmful IMO. People people will just remove them to make the linter happy and then the information is gone.

@creed-bratton
Copy link
Copy Markdown
Contributor Author

Dropped godox per your feedback.

Fixed the remaining violations:

  • noctx: replaced p.client.Get with http.NewRequestWithContext + Do
  • ireturn: added PublicCode to the allow list in settings -- it is the intended public API return type, not an accidental bare interface
  • errname: //nolint on ValidationResults -- renaming to ValidationResultsError would be a breaking API change

@creed-bratton creed-bratton force-pushed the enable-linters-phase1 branch from 71a05a4 to b2f2bd3 Compare March 25, 2026 10:42
@creed-bratton creed-bratton force-pushed the enable-linters-phase1 branch from b2f2bd3 to 1b8c8c4 Compare March 25, 2026 10:48
@bfabio bfabio merged commit c65253d into italia:main Mar 25, 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