-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy path.golangci.yml
More file actions
102 lines (91 loc) · 1.82 KB
/
.golangci.yml
File metadata and controls
102 lines (91 loc) · 1.82 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# golangci-lint configuration
# https://golangci-lint.run/usage/configuration/
run:
timeout: 5m
tests: true
exclude-dirs:
- vendor
- testdata
- testing
linters:
enable:
# Default linters
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- typecheck
- unused
# Additional linters
- gofmt
- goimports
- misspell
- unconvert
- gocyclo
- goprintffuncname
- gosec
- nakedret
- noctx
- nolintlint
- predeclared
- thelper
- tparallel
- unparam
disable:
- depguard
- dogsled
- dupl
- funlen
- gochecknoinits
- goconst
- gocritic
- gocognit
- lll
- nestif
- testpackage
- wrapcheck
- exhaustive
- exhaustruct
- nlreturn
linters-settings:
gofmt:
simplify: true
goimports:
local-prefixes: github.com/bluet/syspkg
govet:
enable:
- shadow
misspell:
locale: US
gocyclo:
min-complexity: 20
issues:
exclude-rules:
# Exclude some linters from running on tests files
- path: _test\.go
linters:
- gosec
- gocyclo
# Exclude shadow warning for common patterns
- linters:
- govet
text: "shadow: declaration of \"err\""
# Exclude misspelling in specific cases
- linters:
- misspell
text: "cancelled"
# Exclude unnecessary conversion in utils (string([]byte) is explicit)
- path: utils\.go
linters:
- unconvert
text: "unnecessary conversion"
# Exclude high cyclomatic complexity for main function
- path: cmd/syspkg/main\.go
linters:
- gocyclo
text: "cyclomatic complexity.*of func `main`"
# Maximum issues count per one linter
max-issues-per-linter: 50
# Maximum count of issues with the same text
max-same-issues: 10