Repository navigation
Expand file tree
/
Copy path.golangci.yml
More file actions
84 lines (82 loc) · 2.44 KB
/
Copy path.golangci.yml
File metadata and controls
84 lines (82 loc) · 2.44 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
version: "2"
linters:
default: none
enable:
- errcheck
- forbidigo
- gocritic
- gocyclo
- govet
- funlen
- gocognit
- ineffassign
- nestif
- revive
- unparam
- unused
settings:
forbidigo:
forbid:
# Providers must call delivery transport: it is the one place that
# turns HTTP statuses into success / rate-limited / permanent /
# retryable. A
# provider with its own http.NewRequest gets its own status bugs.
- pattern: '^http\.(NewRequest|NewRequestWithContext|Post|Get|Head|PostForm)$'
msg: "alert providers must send through delivery transport, not raw net/http"
govet:
disable:
- inline
funlen:
lines: 50
statements: 40
ignore-comments: true
gocognit:
min-complexity: 15
nestif:
min-complexity: 4
revive:
rules:
- name: exported
- name: var-naming
gocyclo:
min-complexity: 20
errcheck:
exclude-functions:
- "(*compress/gzip.Reader).Close"
- "(*compress/gzip.Writer).Close"
- "(*os.File).Close"
- "(io.Closer).Close"
- "(*bytes.Buffer).Write"
- "(strings.Builder).WriteString"
- "(fmt.Stringer).String"
exclusions:
generated: lax
rules:
# Tests intentionally ignore errors (e.g. seeding store/indexers).
- path: "_test.go"
linters: [errcheck, unparam, gocritic]
# The raw-HTTP rule is only about alert providers; shared transport is
# the one allowed production request boundary.
# Readability linters apply to the core packages only.
- linters: [funlen, gocognit, nestif, revive]
path-except: "^internal/(inventory|detection|rootcause|incident|pipeline|storage|notification|replay|scorecard|scenarios|redact|delivery|app|health|kubeclient|config)(/|$)"
- linters: [funlen, gocognit, nestif]
path: "_test.go"
- linters: [revive]
path: "_test.go"
text: "exported"
# health.HealthServer and health.HealthResponse are referenced by
# AGENTS.md and the docs as public names; renaming them is a
# separate, deliberate change.
- linters: [revive]
path: "^internal/health/"
text: "stutters"
- linters: [forbidigo]
path-except: "^internal/alert/"
formatters:
enable:
- goimports
settings:
goimports:
local-prefixes:
- github.com/abahmed/kwatch