-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.golangci.yml
More file actions
124 lines (119 loc) · 2.49 KB
/
Copy path.golangci.yml
File metadata and controls
124 lines (119 loc) · 2.49 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
# distill lint policy — golangci-lint v2
# Mirrors the workspace policy (~/go/src/.golangci.yml; source: ~/.claude/rules/go-lint-pack.md).
# Per-repo file so `golangci-lint run ./...` is self-contained for public release.
version: "2"
linters:
enable:
# Correctness
- govet
- staticcheck
- errcheck
- ineffassign
- unused
# Security
- gosec
# Strict
- gocritic
- gocyclo
- dupl
# LLM-Friendly Clean Code
- gocognit
- funlen
- nestif
- goconst
- gochecknoinits
- gochecknoglobals
- revive
# Resource Safety
- bodyclose
- sqlclosecheck
- noctx
# Error Handling
- errorlint
- nilerr
# Correctness
- exhaustive
- unparam
- unconvert
- copyloopvar
- fatcontext
- nakedret
# Performance
- perfsprint
# slog Hygiene
- sloglint
settings:
gocyclo:
min-complexity: 15
gocognit:
min-complexity: 20
funlen:
lines: 80
statements: 50
nestif:
min-complexity: 4
goconst:
min-len: 2
min-occurrences: 3
dupl:
threshold: 100
exhaustive:
check:
- switch
- map
nakedret:
max-func-lines: 0
nolintlint:
require-explanation: true
require-specific: true
allow-no-explanation: [funlen, gocognit]
perfsprint:
strconcat: false
sloglint:
no-global: all
context: scope
gosec:
excludes:
- G104 # deferred .Close() on read-only file
- G304 # validated path variables
govet:
enable:
- shadow
revive:
rules:
- name: exported
- name: unexported-return
- name: indent-error-flow
- name: var-naming
- name: argument-limit
arguments: [5]
- name: function-result-limit
arguments: [3]
- name: cognitive-complexity
arguments: [20]
- name: empty-block
- name: unnecessary-stmt
- name: confusing-naming
- name: confusing-results
exclusions:
paths:
- vendor
- generated
- third_party
rules:
# Test files: relax noisy linters
- path: _test\.go
linters:
- dupl
- goconst
- bodyclose
- noctx
- funlen
- gosec
# cmd/ package: CLI command-wiring globals are idiomatic
- path: cmd/
linters:
- gochecknoglobals
issues:
max-issues-per-linter: 20
max-same-issues: 5