Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable a few new linters #3269

Merged
merged 2 commits into from
Jan 20, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Enable a few new linters
* exptostd ensures features in the standard library are used rather
  than their experimental predecessors
* nilnesserr flags error checks that don’t return the checked error
* usetesting flags function calls that should be replaced with
  variants in the testing package

Signed-off-by: Stephen Kitt <[email protected]>
skitt committed Jan 16, 2025

Verified

This commit was signed with the committer’s verified signature.
skitt Stephen Kitt
commit 55c303d80838168b26c1ba60bbbbb3d2db6b0803
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -70,6 +70,7 @@ linters:
- errname
# - execinquery # No SQL
- exhaustive
- exptostd
# - exhaustruct # This is too cumbersome as it requires all string, int, pointer et al fields to be initialized even when the
# type's default suffices, which is most of the time
- fatcontext
@@ -120,6 +121,7 @@ linters:
- nakedret
# - nestif # This calculates cognitive complexity but we're doing that elsewhere
- nilerr
- nilnesserr
- nilnil
# - nlreturn # This is reasonable with a block-size of 2 but setting it above isn't honored
# - noctx # We don't send HTTP requests
@@ -154,6 +156,7 @@ linters:
- unparam
- unused
- usestdlibvars
- usetesting
# - varnamelen # It doesn't seem necessary to enforce a minimum variable name length
- wastedassign
- whitespace