Skip to content

Commit ae36f48

Browse files
sheepman4267silkeh
andauthored
Reformat .golangci.yaml to work with their new configuration format (#130)
Co-authored-by: Silke Hofstra <silke@slxh.eu>
1 parent e3f3ab2 commit ae36f48

File tree

17 files changed

+224
-191
lines changed

17 files changed

+224
-191
lines changed

.golangci.yaml

Lines changed: 99 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,35 @@
11
---
2+
version: "2"
3+
4+
issues:
5+
max-issues-per-linter: 0
6+
max-same-issues: 0
7+
8+
severity:
9+
default: major
10+
11+
formatters:
12+
enable:
13+
- gci
14+
- gofmt
15+
- gofumpt
16+
17+
settings:
18+
gci:
19+
sections:
20+
- standard
21+
- default
22+
- prefix(github.com/getsolus/solbuild)
23+
24+
exclusions:
25+
generated: lax
26+
paths:
27+
- third_party$
28+
- builtin$
29+
- examples$
30+
231
linters:
3-
enable-all: true
32+
default: all
433
disable:
534
# Disabled to get codebase to pass the linter.
635
# We can enable these one at a time.
@@ -17,99 +46,84 @@ linters:
1746
- noctx
1847
- perfsprint
1948
- revive
20-
- stylecheck
2149
- wrapcheck
2250
# Disabled permanently
51+
- depguard # manage using go.mod for now
2352
- exhaustruct # structs may be uninitialized
53+
- funcorder # functions are allowed in any order
2454
- nlreturn # covered by wsl cuddle rules
25-
- paralleltest # tests are acceptable in sequence
26-
- goimports # conflicts with GCI
27-
- depguard # manage using go.mod for now
55+
- noinlineerr # inline errors are allowed for readability
2856
- nonamedreturns # named returns are acceptable in short functions
57+
- paralleltest # tests are acceptable in sequence
2958
# Deprecated
30-
- execinquery
31-
- exportloopref
32-
- gomnd
33-
severity:
34-
default-severity: major
35-
36-
issues:
37-
fast: false
38-
max-issues-per-linter: 0
39-
max-same-issues: 0
40-
exclude-use-default: false
41-
exclude-case-sensitive: true
42-
exclude-rules:
43-
- path: _test\.go
44-
linters:
45-
- gochecknoglobals
46-
- errcheck
47-
- wrapcheck
48-
- gosec
49-
- goerr113
50-
51-
linters-settings:
52-
varnamelen:
53-
min-name-length: 1
54-
55-
exhaustive:
56-
default-signifies-exhaustive: true
57-
58-
gci:
59-
sections:
60-
- standard
61-
- default
62-
- prefix(github.com/getsolus/solbuild)
63-
64-
gomnd:
65-
ignored-numbers: ['2', '4', '8', '16', '32', '64', '10']
59+
- wsl
60+
exclusions:
61+
generated: lax
62+
rules:
63+
- linters:
64+
- err113
65+
- errcheck
66+
- gochecknoglobals
67+
- gosec
68+
- wrapcheck
69+
path: _test\.go
70+
- linters: [staticcheck]
71+
text: "ST1000:"
72+
paths:
73+
- third_party$
74+
- builtin$
75+
- examples$
76+
settings:
77+
exhaustive:
78+
default-signifies-exhaustive: true
6679

67-
gosec:
68-
excludes: []
80+
govet:
81+
disable:
82+
- fieldalignment
83+
enable-all: true
6984

70-
govet:
71-
enable-all: true
72-
disable:
73-
- fieldalignment # misalignment is accepted
85+
misspell:
86+
ignore-rules:
87+
- evolveos
7488

75-
misspell:
76-
ignore-words:
77-
- evolveos
89+
revive:
90+
enable-all-rules: false
91+
rules:
92+
- name: blank-imports
93+
- name: context-as-argument
94+
- name: context-keys-type
95+
- name: dot-imports
96+
- name: error-return
97+
- name: error-strings
98+
- name: error-naming
99+
- name: exported
100+
- name: if-return
101+
- name: increment-decrement
102+
- name: var-naming
103+
- name: var-declaration
104+
- name: package-comments
105+
- name: range
106+
- name: receiver-naming
107+
- name: time-naming
108+
- name: unexported-return
109+
- name: indent-error-flow
110+
- name: errorf
111+
- name: empty-block
112+
- name: superfluous-else
113+
- name: unused-parameter
114+
- name: unreachable-code
115+
- name: redefines-builtin-id
78116

79-
revive:
80-
enable-all-rules: false
81-
rules: # see https://github.com/mgechev/revive#recommended-configuration
82-
- name: blank-imports
83-
- name: context-as-argument
84-
- name: context-keys-type
85-
- name: dot-imports
86-
- name: error-return
87-
- name: error-strings
88-
- name: error-naming
89-
- name: exported
90-
- name: if-return
91-
- name: increment-decrement
92-
- name: var-naming
93-
- name: var-declaration
94-
- name: package-comments
95-
- name: range
96-
- name: receiver-naming
97-
- name: time-naming
98-
- name: unexported-return
99-
- name: indent-error-flow
100-
- name: errorf
101-
- name: empty-block
102-
- name: superfluous-else
103-
- name: unused-parameter
104-
- name: unreachable-code
105-
- name: redefines-builtin-id
117+
staticcheck:
118+
checks:
119+
- all
106120

107-
stylecheck:
108-
checks: [all]
121+
tagalign:
122+
order:
123+
- zero
124+
- short
125+
- long
126+
- desc
109127

110-
tagalign:
111-
order:
112-
- zero
113-
- short
114-
- long
115-
- desc
128+
varnamelen:
129+
min-name-length: 1

0 commit comments

Comments
 (0)