-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.golangci.yml
203 lines (197 loc) · 4.55 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
run:
issues-exit-code: 1
timeout: 5m
linters-settings:
depguard:
list-type: blacklist
packages:
- github.com/sirupsen/logrus
- log
- io/ioutil
dupl:
threshold: 100
funlen:
lines: 20
statements: 10
gci:
no-inline-comments: true
no-prefix-comments: true
sections:
- standard
- default
- prefix(github.com/xelaj/tl)
goconst:
min-len: 3
min-occurrences: 2
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
disabled-checks:
- dupImport # https://github.com/go-critic/go-critic/issues/845
gocyclo:
min-complexity: 15
goimports:
local-prefixes: github.com/xelaj/tl
revive:
min-confidence: 0
enable-all-rules: true
ignore-generated-header: true
rules:
- { name: argument-limit, arguments: [4] }
- { name: cognitive-complexity, arguments: [7] }
- { name: function-result-limit, arguments: [2] }
- { name: max-public-structs, arguments: [15] }
- { name: banned-characters, disabled: true } # replaced to ???
- { name: function-length, disabled: true } # replaced to funlen
- { name: file-header, disabled: true } # replaced to goheader
- { name: cyclomatic, disabled: true } # replaced to gocyclo
- { name: line-length-limit, disabled: true } # replaced to lll
- { name: add-constant, disabled: true } # replaced to gomnd
gomnd:
settings:
mnd:
# don't include the "operation" and "assign"
checks: [argument, case, condition, return]
govet:
check-shadowing: true
enable-all: true
lll:
line-length: 100
tab-width: 4
misspell:
locale: US
goheader:
values:
const:
PACKAGE_NAME: tl
OWNER_COMPANY: Xelaj Software
LICENSE_URL: https://github.com/xelaj/tl/blob/master/LICENSE_README.md
template-path: docs/.license_header.txt
ireturn:
reject:
- anon
forbidigo:
forbid:
- p: ^os\.ReadFile$
pkg: ^os$
msg: >-
os related functions are allowed only via abstractions. Please, use
io/fs package.
exclude-godoc-examples: true
analyze-types: true
issues:
fix: true
exclude-rules:
- path: _test\.go
linters:
- funlen
- dupl
- gosec
- govet
- gomnd
- gochecknoglobals # И ЧТОЭ
# - typecheck # false positive on dot import, don't know why # OR NOT???
- path: cmd/
linters:
- gochecknoglobals
# tired for configuring go vet... declaration based on ordering, false positive
- path: schema/internal/declaration/
linters:
- govet
text: "^fieldalignment: struct with"
linters:
disable-all: true
enable:
- asciicheck
- bidichk
# - bodyclose # 1.18 incompatible
- containedctx
# - contextcheck # 1.18 incompatible
- cyclop
- deadcode
- decorder
- depguard
- dogsled
- dupl
- durationcheck
- errcheck
- errchkjson
# - errname # see CONTRIBUTING.md to get more info about errors formating
- errorlint
- exhaustive
# - exhaustivestruct
- exportloopref
- forbidigo
- forcetypeassert
- funlen
- gci
- gochecknoglobals
- gochecknoinits
- gocognit
- goconst
- goheader
# - gocritic # 1.18 incompatible
- gocyclo
- godot
- godox
- goerr113
- gofmt
- gofumpt
- goheader
- goimports
- gomnd
- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
# - gosimple # 1.18 incompatible
- govet
- grouper
- ifshort
- importas
- ineffassign
# - interfacer # deprecated
- ireturn
- lll
- maintidx
- makezero
- misspell
- nakedret
- nestif
# - nilerr # 1.18 incompatible
- nilnil
- nlreturn
# - noctx # 1.18 incompatible
- nolintlint
- paralleltest
- prealloc
- predeclared
- promlinter
- revive
# - rowserrcheck # 1.18 incompatible
# - sqlclosecheck # 1.18 incompatible
# - staticcheck # 1.18 incompatible
# - structcheck # 1.18 incompatible
# - stylecheck # 1.18 incompatible
- tagliatelle
- tenv
- testpackage
- thelper
# - tparallel # 1.18 incompatible
- typecheck
- unconvert
# - unparam # 1.18 incompatible
# - unused # 1.18 incompatible
- varcheck
# - varnamelen
# - wastedassign # 1.18 incompatible
- whitespace
- wrapcheck
# - wsl
service:
project-path: github.com/xelaj/tl
golangci-lint-version: 1.45.x