Skip to content

Commit 06b485f

Browse files
committed
golangci-lint migrate
1 parent f8a5f90 commit 06b485f

File tree

1 file changed

+100
-112
lines changed

1 file changed

+100
-112
lines changed

cfn-resources/.golangci.yml

Lines changed: 100 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -1,131 +1,119 @@
1-
linters-settings:
2-
exhaustive:
3-
default-signifies-exhaustive: true
4-
5-
gocritic:
6-
enabled-tags:
7-
- diagnostic
8-
- experimental
9-
- opinionated
10-
- performance
11-
- style
12-
disabled-checks:
13-
# cfn handlers generated automatically, below are exempted for the same
14-
- hugeParam
15-
- paramTypeCombine
16-
govet:
17-
enable-all: true
18-
19-
revive:
20-
# see https://github.com/mgechev/revive#available-rules for details.
21-
ignore-generated-header: true
22-
severity: warning
23-
rules:
24-
- name: blank-imports
25-
- name: context-as-argument
26-
- name: context-keys-type
27-
- name: dot-imports
28-
- name: error-return
29-
- name: error-strings
30-
- name: error-naming
31-
- name: errorf
32-
- name: exported
33-
- name: indent-error-flow
34-
- name: if-return
35-
- name: increment-decrement
36-
- name: var-naming
37-
- name: var-declaration
38-
- name: package-comments
39-
- name: range
40-
- name: receiver-naming
41-
- name: time-naming
42-
- name: unexported-return
43-
- name: indent-error-flow
44-
- name: errorf
45-
- name: empty-block
46-
- name: superfluous-else
47-
- name: struct-tag
48-
# Too many unusued parameters, skipping this check for now
49-
#- name: unused-parameter
50-
- name: unreachable-code
51-
- name: redefines-builtin-id
52-
misspell:
53-
locale: US
54-
ignore-words:
55-
- cancelled
56-
lll:
57-
# Default is 120. '\t' is counted as 1 character.
58-
# set our project to 500, as we are adding open api field description in the schema.
59-
# also, for anyone using vscode, use the following configs:
60-
# "rewrap.wrappingColumn": 500 ... requires the rewrap plugin
61-
# "editor.rulers": [500]
62-
line-length: 500
63-
nestif:
64-
# minimal complexity of if statements to report, 5 by default
65-
min-complexity: 7
66-
mnd:
67-
checks:
68-
- case
69-
- operation
70-
- return
71-
funlen:
72-
lines: 360
73-
statements: 120
1+
version: "2"
2+
run:
3+
build-tags:
4+
- integration
5+
modules-download-mode: readonly
6+
tests: true
747
linters:
75-
disable-all: true
8+
default: none
769
enable:
10+
- copyloopvar
7711
- dogsled
7812
- errcheck
13+
- exhaustive
7914
- funlen
8015
- gocritic
81-
- gofmt
82-
- goimports
83-
- revive
84-
- mnd
8516
- goprintffuncname
8617
- gosec
87-
- gosimple
8818
- govet
8919
- ineffassign
9020
- lll
21+
- makezero
9122
- misspell
23+
- mnd
9224
- nakedret
25+
- noctx
9326
- nolintlint
27+
- revive
9428
- rowserrcheck
95-
- copyloopvar
9629
- staticcheck
97-
- stylecheck
98-
- typecheck
30+
- testifylint
31+
- testpackage
32+
- thelper
9933
- unconvert
10034
- unused
10135
- whitespace
102-
- thelper
103-
- testifylint
104-
- exhaustive
105-
- makezero
106-
- noctx
107-
- tenv
108-
- testpackage
109-
110-
# don't enable:
111-
# - deadcode
112-
# - varcheck
113-
# - structcheck
114-
# - depguard # Go linter that checks if package imports are in a list of acceptable packages [fast: true, auto-fix: false]
115-
# - gocyclo # we already have funlen lint
116-
# - dupl # we have a lot of duplicate test cases
117-
# - gochecknoinits # we need the init function for the provider
118-
# - gochecknoglobals # we need some global variables
119-
# - unparam # Forces to create global variables when one variable is repeated in different functions
120-
# - goerr113 # It does not allow you to return an error, you need to save the error in a variable to do it
121-
# - goconst
122-
# - gocognit
123-
issues:
124-
exclude:
125-
- declaration of ".*" shadows declaration at line .*
126-
run:
127-
timeout: 10m
128-
tests: true
129-
build-tags:
130-
- integration
131-
modules-download-mode: readonly
36+
settings:
37+
exhaustive:
38+
default-signifies-exhaustive: true
39+
funlen:
40+
lines: 360
41+
statements: 120
42+
gocritic:
43+
disabled-checks:
44+
- hugeParam
45+
- paramTypeCombine
46+
enabled-tags:
47+
- diagnostic
48+
- experimental
49+
- opinionated
50+
- performance
51+
- style
52+
govet:
53+
enable-all: true
54+
lll:
55+
line-length: 500
56+
misspell:
57+
locale: US
58+
ignore-rules:
59+
- cancelled
60+
mnd:
61+
checks:
62+
- case
63+
- operation
64+
- return
65+
nestif:
66+
min-complexity: 7
67+
revive:
68+
severity: warning
69+
rules:
70+
- name: blank-imports
71+
- name: context-as-argument
72+
- name: context-keys-type
73+
- name: dot-imports
74+
- name: error-return
75+
- name: error-strings
76+
- name: error-naming
77+
- name: errorf
78+
- name: exported
79+
- name: indent-error-flow
80+
- name: if-return
81+
- name: increment-decrement
82+
- name: var-naming
83+
- name: var-declaration
84+
- name: package-comments
85+
- name: range
86+
- name: receiver-naming
87+
- name: time-naming
88+
- name: unexported-return
89+
- name: indent-error-flow
90+
- name: errorf
91+
- name: empty-block
92+
- name: superfluous-else
93+
- name: struct-tag
94+
- name: unreachable-code
95+
- name: redefines-builtin-id
96+
exclusions:
97+
generated: lax
98+
presets:
99+
- comments
100+
- common-false-positives
101+
- legacy
102+
- std-error-handling
103+
rules:
104+
- path: (.+)\.go$
105+
text: declaration of ".*" shadows declaration at line .*
106+
paths:
107+
- third_party$
108+
- builtin$
109+
- examples$
110+
formatters:
111+
enable:
112+
- gofmt
113+
- goimports
114+
exclusions:
115+
generated: lax
116+
paths:
117+
- third_party$
118+
- builtin$
119+
- examples$

0 commit comments

Comments
 (0)