forked from eksctl-io/eksctl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.golangci.yml
More file actions
187 lines (164 loc) · 5.62 KB
/
.golangci.yml
File metadata and controls
187 lines (164 loc) · 5.62 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
182
183
184
185
186
187
# options for analysis running
version: "2"
run:
go: "1.25"
# default concurrency is a available CPU number
concurrency: 4
# exit code when at least one issue was found, default is 1
issues-exit-code: 1
# include test files or not, default is true
tests: true
# list of build tags, all linters use it. Default is empty list.
build-tags:
- release
- integration
# output configuration options
output:
formats:
tab:
# print lines of code with issue, default is true
print-issued-lines: true
# print linter name in the end of issue text, default is true
print-linter-name: true
# use colors, default is true
colors: false
linters:
# default set of linters, none disables all linters by default.
default: none
# enable specific linters
enable:
- bodyclose
- errcheck
- govet
- ineffassign
- misspell
- revive
- staticcheck
- unused
# all available settings of specific linters
settings:
dupl:
# tokens count to trigger issue, 150 by default
threshold: 100
errcheck:
# report about not checking of errors in type assetions: `a := b.(MyStruct)`;
# default is false: such cases aren't reported by default.
check-type-assertions: false
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
# default is false: such cases aren't reported by default.
check-blank: false
goconst:
# minimal length of string constant, 3 by default
min-len: 3
# minimal occurrences count to trigger, 3 by default
min-occurrences: 3
gocyclo:
# minimal code complexity to report, 30 by default (but we recommend 10-20)
min-complexity: 10
lll:
# max line length, lines longer will be reported. Default is 120.
# '\t' is counted as 1 character by default, and can be changed with the tab-width option
line-length: 120
# tab width in spaces. Default to 1.
tab-width: 1
nakedret:
# make an issue if func has more lines of code than this setting and it has naked returns; default is 30
max-func-lines: 30
revive:
confidence: 0.8
severity: warning
rules:
- name: blank-imports
- name: context-as-argument
- name: context-keys-type
- name: error-return
- name: error-strings
- name: error-naming
- name: exported
- name: if-return
- name: increment-decrement
- name: var-naming
- name: var-declaration
- name: package-comments
- name: range
- name: receiver-naming
- name: time-naming
- name: unexported-return
- name: indent-error-flow
- name: errorf
staticcheck:
checks:
- all
- -QF1001 # disable the rule QF1001: Apply De Morgan’s law
- -SA1019 # disbale the rule SA1019: Using a deprecated function, variable, constant or field
- -ST1001 # disable the rule ST1001: Dot imports are discouraged
- -ST1003 # disbale the rule ST1003: Poorly chosen identifier
- -ST1005 # disbale the rule ST1005: Incorrectly formatted error string
unparam:
# Inspect exported functions, default is false. Set to true if no external program/library imports your code.
# XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
# if it's called for subdir of a project it can't find external interfaces. All text editor integrations
# with golangci-lint call it on a directory with the changed file.
check-exported: false
# defines a set of rules to ignore issues.
exclusions:
# Mode of the generated files analysis, lax excludes sources if they contain lines like `autogenerated file`, `code generated`, `do not edit`, etc.
generated: lax
# Predefined exclusion rules.
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
# excluding configuration per-path, per-linter, per-text and per-source.
rules:
- linters:
- golint
text: should not use dot imports|don't use an underscore in package name
- linters:
- revive
text: avoid meaningless package names
# Which file paths to exclude: they will be analyzed, but issues from them won't be reported.
# "/" will be replaced by the current OS file path separator to properly work on Windows.
# Default: []
paths:
- ^pkg\/nodebootstrap\/assets.go
- .*\/export_test.go
- ^pkg\/cfn\/builder\/fakes\/fake_cfn_template.go
- ^vendor$
- ^build$
- ^pkg\/eks\/mocks$
- ^pkg\/goformation*
- third_party$
- builtin$
- examples$
issues:
# maximum count of issues with the same text, default is 3
max-same-issues: 20
formatters:
# enable specific formatters
enable:
- gofmt
- goimports
# all available settings of specific formatters.
settings:
gofmt:
# simplify code: gofmt with `-s` option, true by default
simplify: false
exclusions:
# Mode of the generated files analysis, lax excludes sources if they contain lines like `autogenerated file`, `code generated`, `do not edit`, etc.
generated: lax
# Which file paths to exclude.
# This option is ignored when using `--stdin` as the path is unknown.
# Default: []
paths:
- ^pkg\/nodebootstrap\/assets.go
- .*\/export_test.go
- ^pkg\/cfn\/builder\/fakes\/fake_cfn_template.go
- ^vendor$
- ^build$
- ^pkg\/eks\/mocks$
- ^pkg\/goformation*
- third_party$
- builtin$
- examples$