Skip to content

Commit

Permalink
Enable a few new linters
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
skitt authored and tpantelis committed Jan 20, 2025
1 parent 3c24597 commit 662dbfd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -154,6 +156,7 @@ linters:
- unparam
- unused
- usestdlibvars
- usetesting
# - varnamelen # It doesn't seem necessary to enforce a minimum variable name length
- wastedassign
- whitespace
Expand Down

0 comments on commit 662dbfd

Please sign in to comment.