Skip to content

Commit d149eca

Browse files
committed
chore: enable staticcheck
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
1 parent 3c34181 commit d149eca

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

.golangci.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ linters:
2727
- perfsprint
2828
- predeclared
2929
- revive
30+
- staticcheck
3031
- testifylint
3132
- thelper
3233
- unparam
@@ -35,7 +36,6 @@ linters:
3536
- errcheck
3637
- govet
3738
- ineffassign
38-
- staticcheck
3939
- unused
4040
settings:
4141
gocritic:
@@ -105,6 +105,25 @@ linters:
105105
- ["ID"] # AllowList
106106
- ["VM"] # DenyList
107107
- - upperCaseConst: true # Extra parameter (upperCaseConst|skipPackageNameChecks)
108+
staticcheck:
109+
checks:
110+
- all
111+
# TODO: remove this lines after fixing all the issues
112+
- -QF1001 # Apply De Morgan’s law
113+
- -QF1002 # Convert untagged switch to tagged switch
114+
- -QF1006 # Lift if+break into loop condition
115+
- -S1001 # Replace for loop with call to copy
116+
- -SA2002 # Called testing.T.FailNow or SkipNow in a goroutine, which isn’t allowed
117+
- -SA1019 # Using a deprecated function, variable, constant or field
118+
- -SA4003 # Comparing unsigned values against negative values is pointless
119+
- -SA4004 # The loop exits unconditionally after one iteration
120+
- -SA4006 # A value assigned to a variable is never read before being overwritten. Forgotten error check or dead code?
121+
- -SA4008 # The variable in the loop condition never changes, are you incrementing the wrong variable?
122+
- -SA5003 # Defers in infinite loops will never execute
123+
- -SA9003 # Empty body in an if or else branch
124+
- -ST1003 # Poorly chosen identifier
125+
- -ST1005 # Incorrectly formatted error string
126+
- -ST1017 # Don’t use Yoda conditions
108127
testifylint:
109128
enable-all: true
110129
usetesting:

0 commit comments

Comments
 (0)