-
Notifications
You must be signed in to change notification settings - Fork 180
Expand file tree
/
Copy path.golangci.yml
More file actions
77 lines (66 loc) · 1.78 KB
/
.golangci.yml
File metadata and controls
77 lines (66 loc) · 1.78 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
# golangci-lint configuration
# https://golangci-lint.run/usage/configuration/
run:
timeout: 5m
skip-dirs:
- example
- test
skip-files:
- "_test\\.go$"
linters:
disable-all: true
enable:
# Basic checks
- errcheck # unchecked errors
- govet # go vet
- staticcheck # static analysis
- unused # unused code
- ineffassign # ineffectual assignments
- gosimple # code simplification
# Security (gradual enablement)
- gosec # security scanner
linters-settings:
errcheck:
check-type-assertions: false
check-blank: false
govet:
enable-all: true
staticcheck:
checks: ["all", "-SA1019"] # allow deprecated usage
gosec:
# Exclude framework design decisions
excludes:
- G104 # errors unhandled (covered by errcheck)
- G115 # integer overflow (legacy code, fix gradually)
- G301 # directory permissions (framework design)
- G302 # file permissions (framework design)
- G304 # file path inclusion (framework feature)
- G401 # weak crypto md5/sha1 (compatibility)
- G405 # weak crypto des (compatibility)
- G501 # blocklisted import md5
- G502 # blocklisted import des
- G505 # blocklisted import sha1
issues:
max-issues-per-linter: 50
max-same-issues: 10
new-from-rev: ""
exclude-rules:
# Exclude test files from strict checks
- path: _test\.go
linters:
- errcheck
- gosec
# Exclude example files
- path: example/
linters:
- errcheck
- gosec
# Exclude generated files
- path: mock\.go
linters:
- gosec
output:
formats:
- format: colored-line-number
print-issued-lines: true
print-linter-name: true