-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.golangci.yml
More file actions
61 lines (51 loc) · 1.83 KB
/
.golangci.yml
File metadata and controls
61 lines (51 loc) · 1.83 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
# golangci-lint configuration for AxonFlow
# Version 2.x compatible configuration
# https://golangci-lint.run/docs/configuration/
version: "2"
run:
timeout: 5m
modules-download-mode: readonly
allow-parallel-runners: true
linters:
# Replace disable-all with default: none
default: none
enable:
# Essential linters
- errcheck # Check for unchecked errors
- govet # Go vet
- ineffassign # Detect ineffectual assignments
- staticcheck # Go static analysis (includes gosimple, stylecheck in v2)
- unused # Check for unused code
# Settings moved under linters in v2
settings:
errcheck:
check-type-assertions: false # Type assertions are typically intentional
check-blank: false # Allow explicit _ = ignores
govet:
disable:
- fieldalignment # Too pedantic, optimizing struct layout isn't worth the noise
# Exclusion rules (moved from issues.exclude-rules in v2)
exclusions:
presets: [] # No default exclusions
paths:
- ".*_test\\.go$" # Skip test files
rules:
# Exclude errcheck for rows.Close in defer - error is typically logged/ignored
- linters:
- errcheck
text: "Error return value of .*(r|R)ows\\.Close.* is not checked"
# Exclude errcheck for tx.Rollback in error handling - we're already in error path
- linters:
- errcheck
text: "Error return value of .*\\.(Rollback|rollback).* is not checked"
# Exclude errcheck for response body Close - standard pattern
- linters:
- errcheck
text: "Error return value of .*Body\\.Close.* is not checked"
# Allow defensive nil checks before range (S1031) - more explicit/consistent
- linters:
- staticcheck
text: "S1031"
issues:
max-issues-per-linter: 0
max-same-issues: 0