-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.golangci.yml
More file actions
110 lines (95 loc) · 2.76 KB
/
Copy path.golangci.yml
File metadata and controls
110 lines (95 loc) · 2.76 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
run:
timeout: 5m
tests: true
modules-download-mode: readonly
go: '1.23'
linters:
enable:
- errcheck # Check for unchecked errors
- gosimple # Simplify code
- govet # Go vet checks
- ineffassign # Detect ineffectual assignments
- staticcheck # Static analysis
- unused # Detect unused code
- gofmt # Check formatting
- goimports # Check imports
- misspell # Spell checker
- revive # Drop-in replacement for golint
- gosec # Security checker
- noctx # HTTP requests should use context
- gocyclo # Cyclomatic complexity
- typecheck # Type checking
- goconst # Repeated strings that should be constants
- unconvert # Unnecessary type conversions
- unparam # Unused function parameters
- nakedret # Naked returns in long functions
linters-settings:
gocyclo:
min-complexity: 20
gosec:
excludes:
- G115 # Integer overflow conversions (false positives for bounded values)
- G304 # File path from variable (acceptable in CLI tools)
- G306 # WriteFile permissions (0644 is fine for reports)
- G404 # Use of weak random number generator (we use crypto/rand)
errcheck:
check-type-assertions: false
check-blank: false
govet:
enable-all: true
disable:
- shadow # Too many false positives in tests
- fieldalignment # Optimization suggestions, not bugs
revive:
rules:
- name: exported
arguments:
- "checkPrivateReceivers"
- "sayRepetitiveInsteadOfStutters"
nakedret:
max-func-lines: 30
issues:
exclude-use-default: false
max-issues-per-linter: 0
max-same-issues: 0
exclude-rules:
# Exclude some linters from running on tests files
- path: _test\.go
linters:
- gocyclo
- errcheck
- gosec
- goconst
- unparam
# Exclude test helpers from documentation requirements
- path: test_helpers\.go
linters:
- revive
- errcheck
# Exclude twins test infrastructure from strict linting
- path: twins/
linters:
- revive
- errcheck
- goconst
# Exclude bench tools from strict linting
- path: bench/
linters:
- gocyclo
- goconst
# Exclude demo visualization from strict linting
- path: demo/
linters:
- revive
- errcheck
- gosec
- goconst
# Exclude known false positives
- text: "G404:" # Weak random in tests is okay
path: _test\.go
linters:
- gosec
output:
print-issued-lines: true
print-linter-name: true
sort-results: true