-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.golangci.yml
More file actions
181 lines (153 loc) · 3.79 KB
/
Copy path.golangci.yml
File metadata and controls
181 lines (153 loc) · 3.79 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
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
# golangci-lint configuration file
# See: https://golangci-lint.run/usage/configuration/
run:
timeout: 5m
issues-exit-code: 1
tests: true
modules-download-mode: readonly
output:
formats:
- format: colored-line-number
print-issued-lines: true
print-linter-name: true
sort-results: true
linters-settings:
errcheck:
check-type-assertions: true
check-blank: false
exhaustive:
default-signifies-exhaustive: false
funlen:
lines: 150
statements: 80
gocyclo:
min-complexity: 20
godot:
scope: declarations
exclude:
- "^fixme:"
- "^todo:"
gofmt:
simplify: true
gofumpt:
extra-rules: true
goimports:
local-prefixes: github.com/nseba/commit-ai
govet:
enable-all: true
lll:
line-length: 140
misspell:
locale: US
nolintlint:
allow-unused: false
require-explanation: false
require-specific: true
revive:
confidence: 0.8
rules:
- name: atomic
- name: line-length-limit
severity: error
arguments: [140]
staticcheck:
checks: ["all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022"]
stylecheck:
checks: ["all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022"]
depguard:
rules:
main:
deny:
- pkg: "io/ioutil"
desc: "use io or os package instead"
gosec:
excludes:
- G304 # File path provided as taint input
- G301 # Directory permissions
- G306 # File permissions
unparam:
check-exported: false
linters:
disable-all: true
enable:
- bodyclose
- depguard
- dogsled
- dupl
- errcheck
- exhaustive
- funlen
- goconst
- gocritic
- gocyclo
- gofmt
- gofumpt
- goimports
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- lll
- misspell
- nakedret
- noctx
- nolintlint
- rowserrcheck
- staticcheck
- stylecheck
- typecheck
- unconvert
- unparam
- unused
- whitespace
issues:
exclude-dirs:
- vendor
exclude-files:
- ".*\\.pb\\.go$"
uniq-by-line: true
max-issues-per-linter: 0
max-same-issues: 0
new: false
fix: false
exclude-use-default: false
exclude-rules:
# Exclude some linters from running on tests files
- path: _test\.go
linters:
- funlen
- goconst
- lll
- gocyclo
- errcheck
- dupl
- gosec
- unparam
# Exclude init function check for CLI setup
- path: internal/cli/root\.go
text: "don't use `init` function"
linters:
- gochecknoinits
# Allow shadowing in some contexts
- text: "shadow:"
linters:
- govet
path: internal/
# Allow HTTP without context in specific cases
- text: "must not be called"
linters:
- noctx
path: internal/generator/
# Allow file operations for config and templates
- text: "Potential file inclusion via variable"
linters:
- gosec
path: internal/
# Allow unchecked file.Close in defer statements
- text: "Error return value of.*Close.*is not checked"
linters:
- errcheck
severity:
default-severity: error
case-sensitive: false