Skip to content

Commit cd2d701

Browse files
Stefan ErnstStefan Ernst
authored andcommitted
Trying to fix golang ci errors
1 parent ed58587 commit cd2d701

1 file changed

Lines changed: 79 additions & 71 deletions

File tree

.golangci.yml

Lines changed: 79 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,100 @@
1+
version: "2"
2+
13
run:
24
timeout: 5m
35
tests: false
46

57
linters:
68
enable:
79
- errcheck # Check for unchecked errors
8-
- gosimple # Simplify code
910
- govet # Report suspicious constructs
1011
- ineffassign # Detect ineffective assignments
11-
- staticcheck # Go static analysis
12+
- staticcheck # Go static analysis (includes gosimple)
1213
- unused # Find unused code
13-
- gofmt # Check formatting
1414
- misspell # Fix spelling errors
15-
- goimports # Manage imports
1615
- gocritic # Opinionated linter
1716
- gosec # Security checks
1817
- prealloc # Slice preallocation hints
1918
- unconvert # Remove unnecessary conversions
2019
- unparam # Find unused function parameters
2120
- nilerr # Check for nil error returns
2221

23-
linters-settings:
24-
errcheck:
25-
check-type-assertions: true
26-
check-blank: true
27-
exclude-functions:
28-
- (io.Closer).Close
29-
- (*os.File).Close
30-
- (net.Conn).Close
31-
32-
govet:
33-
enable-all: true
34-
disable:
35-
- fieldalignment # Too noisy for now
36-
37-
staticcheck:
38-
checks: ["all"]
39-
40-
gosec:
41-
excludes:
42-
- G104 # Audit errors not checked (handled by errcheck)
43-
- G304 # File path provided as taint input (often intentional)
44-
45-
gocritic:
46-
enabled-tags:
47-
- diagnostic
48-
- performance
49-
- style
50-
disabled-checks:
51-
- hugeParam # Too strict for typical structs
52-
- rangeValCopy # Often not worth micro-optimizing
53-
54-
misspell:
55-
locale: US
56-
57-
goimports:
58-
local-prefixes: windshift
59-
60-
issues:
61-
exclude-use-default: false
62-
max-issues-per-linter: 50
63-
max-same-issues: 10
64-
65-
exclude-rules:
66-
# Ignore long lines in generated files
67-
- path: _gen\.go
68-
linters:
69-
- lll
70-
71-
# Allow unused parameters in main package
72-
- path: main\.go
73-
linters:
74-
- unparam
75-
76-
# Ignore magic numbers in tests
77-
- path: _test\.go
78-
linters:
79-
- gomnd
80-
81-
# Allow dot imports in tests
82-
- path: _test\.go
83-
linters:
84-
- revive
85-
text: "dot-imports"
22+
settings:
23+
errcheck:
24+
check-type-assertions: true
25+
check-blank: true
26+
exclude-functions:
27+
- (io.Closer).Close
28+
- (*os.File).Close
29+
- (net.Conn).Close
30+
31+
govet:
32+
enable-all: true
33+
disable:
34+
- fieldalignment # Too noisy for now
35+
36+
staticcheck:
37+
checks: ["all"]
38+
39+
gosec:
40+
excludes:
41+
- G104 # Audit errors not checked (handled by errcheck)
42+
- G304 # File path provided as taint input (often intentional)
43+
44+
gocritic:
45+
enabled-tags:
46+
- diagnostic
47+
- performance
48+
- style
49+
disabled-checks:
50+
- hugeParam # Too strict for typical structs
51+
- rangeValCopy # Often not worth micro-optimizing
52+
53+
misspell:
54+
locale: US
55+
56+
exclusions:
57+
generated: lax
58+
presets: []
59+
max-issues-per-linter: 50
60+
max-same-issues: 10
61+
62+
rules:
63+
# Ignore long lines in generated files
64+
- path: _gen\.go
65+
linters:
66+
- lll
67+
68+
# Allow unused parameters in main package
69+
- path: main\.go
70+
linters:
71+
- unparam
72+
73+
# Ignore magic numbers in tests
74+
- path: _test\.go
75+
linters:
76+
- mnd
77+
78+
# Allow dot imports in tests
79+
- path: _test\.go
80+
linters:
81+
- revive
82+
text: "dot-imports"
83+
84+
formatters:
85+
enable:
86+
- gofmt # Check formatting
87+
- goimports # Manage imports
88+
89+
settings:
90+
goimports:
91+
local-prefixes: windshift
8692

8793
output:
8894
formats:
89-
- format: colored-line-number
90-
print-issued-lines: true
91-
print-linter-name: true
92-
sort-results: true
95+
text:
96+
colors: true
97+
print-issued-lines: true
98+
print-linter-name: true
99+
sort-order:
100+
- file

0 commit comments

Comments
 (0)