-
Notifications
You must be signed in to change notification settings - Fork 18
/
.golangci.yml
83 lines (80 loc) · 1.76 KB
/
.golangci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
run:
timeout: 5m
linters:
enable:
- bodyclose
- copyloopvar
- dogsled
- dupl
- errcheck
- errorlint
- forcetypeassert
- funlen
- gochecknoglobals
- gochecknoinits
- gocognit
- goconst
- gocritic
- gocyclo
- godot
- godox
- gofmt
- goimports
- gomoddirectives
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- lll
- misspell
- mnd
- nakedret
- nestif
- prealloc
- rowserrcheck
- staticcheck
- stylecheck
- thelper
- tparallel
- typecheck
- unconvert
- unparam
- unused
- whitespace
- wrapcheck
linters-settings:
dupl:
threshold: 100
errcheck:
check-blank: true
gocognit:
min-complexity: 15
gocyclo:
min-complexity: 10
nakedret:
max-func-lines: 0
goconst:
min-occurrences: 3
issues:
exclude-rules:
- path: main.go
linters:
- gochecknoglobals # global in main.go needed for testing
- path: cmd/
linters:
- dupl # CLIs are a lot of similar-looking code!
- wrapcheck # errors don't need to be wrapped in thin CLIs
- path: _test.go
linters:
- dupl # many functions in tests look like duplicates
- funlen # test function can be very long due to test cases
- gochecknoglobals # globals in tests are fine
- gocognit # test functions can be long/complex
- goconst # there are many magic numbers in tests
- gomnd # there are many magic numbers in tests
- wrapcheck # errors don't need to be wrapped in tests
- path: example_*_test.go
linters:
- errcheck # not required to check errors in examples
- ineffassign # not required to check errors in examples