Skip to content

Commit a5e81a7

Browse files
committed
chore: update golangci-lint config to version 2 and fix exclusions
1 parent 04b4fd7 commit a5e81a7

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

.golangci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,41 @@ version: "2"
22

33
run:
44
timeout: 5m
5+
tests: false
56

67
linters:
8+
disable-all: true
79
enable:
10+
- errcheck
811
- revive
12+
- govet
13+
- staticcheck
14+
- gocyclo
15+
- dupl
16+
- gosec
17+
- forbidigo
918
- bodyclose
19+
settings:
20+
gocyclo:
21+
min-complexity: 100
22+
exclusions:
23+
rules:
24+
# Disable all linters for tests
25+
- path: ".*_test\\.go"
26+
linters:
27+
- "*"
28+
# Run some linter only for test files by excluding its issues for everything else.
29+
- path-except: ".*_test\\.go"
30+
linters:
31+
- forbidigo
32+
# Exclude false positive for secret token header name.
33+
- path: "webhook/webhook\\.go"
34+
text: "G101: Potential hardcoded credentials"
35+
# Exclude gosec warning for simple examples.
36+
- path: "examples/.*"
37+
linters:
38+
- gosec
39+
40+
formatters:
41+
enable:
42+
- goimports

0 commit comments

Comments
 (0)