-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.golangci.yml
154 lines (138 loc) · 4.05 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
run:
timeout: 5m
issues-exit-code: 1
tests: false
skip-dirs-use-default: true
modules-download-mode: readonly
output:
format: colored-line-number
linters-settings:
errcheck:
check-type-assertions: true
check-blank: true
funlen:
lines: 60
statements: 40
govet:
check-shadowing: true
settings:
printf: # analyzer name, run `go tool vet help` to see all analyzers
funcs: # run `go tool vet help printf` to see available settings for `printf` analyzer
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
enable:
- atomicalign
enable-all: false
disable-all: false
golint:
min-confidence: 0.8
gocyclo:
min-complexity: 20
gocognit:
min-complexity: 20
dupl:
threshold: 100
goconst:
min-len: 3
min-occurrences: 3
lll:
line-length: 140
tab-width: 1
unused:
check-exported: false
unparam:
check-exported: false
gocritic:
disabled-checks:
- regexpMust
enabled-tags:
- performance
settings: # settings passed to gocritic
captLocal: # must be valid enabled check name
paramsOnly: true
rangeValCopy:
sizeThreshold: 32
godox:
# report any comments starting with keywords, this is useful for TODO or FIXME comments that
# might be left in the code accidentally and should be resolved before merging
keywords: # default keywords are TODO, BUG, and FIXME, these can be overwritten by this setting
- FIXME
- NOTE
- OPTIMIZE # marks code that should be optimized before merging
- HACK # marks hack-arounds that should be removed before merging
whitespace:
multi-if: false # Enforces newlines (or comments) after every multi-line if statement
multi-func: false # Enforces newlines (or comments) after every multi-line function signature
linters:
disable-all: true
enable:
- asciicheck
- bodyclose
- deadcode
- dupl
- errcheck
- exhaustive
- ineffassign
- megacheck
- maligned
- misspell
- gomnd
- gocritic
- gocyclo
- govet
- golint
- goconst
- gosimple
- gosec
- goimports
- goerr113
- lll
- noctx
- sqlclosecheck
- structcheck
- typecheck
- whitespace
- unparam
- unused
presets:
- bugs
- unused
fast: true
issues:
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
# Exclude known linters from partially hard-vendored code,
# which is impossible to exclude via "nolint" comments.
- path: internal/hmac/
text: "weak cryptographic primitive"
linters:
- gosec
# Exclude some staticcheck messages
- linters:
- staticcheck
text: "SA9003:"
# Exclude lll issues for long lines with go:generate
- linters:
- lll
- golint
source: "^//go:generate "
# Independently from option `exclude` we use default exclude patterns,
# it can be disabled by this option. To list all
# excluded by default patterns execute `golangci-lint run --help`.
# Default value for this option is true.
exclude-use-default: true
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
max-issues-per-linter: 0
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
max-same-issues: 0
# Show only new issues: if there are unstaged changes or untracked files,
# only those changes are analyzed, else only changes in HEAD~ are analyzed.
# It's a super-useful option for integration of golangci-lint into existing
# large codebase. It's not practical to fix all existing issues at the moment
# of integration: much better don't allow issues in new code.
# Default is false.
new: false
service:
golangci-lint-version: 1.30.x # use the fixed version to not introduce new linters unexpectedly