-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.golangci.yml
More file actions
97 lines (97 loc) · 4.44 KB
/
.golangci.yml
File metadata and controls
97 lines (97 loc) · 4.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
85
86
87
88
89
90
91
92
93
94
95
96
97
version: "2"
linters:
default: all
disable:
- "dupl" # One day
- "dupword" # One day
- "err113" # Eventually
- "errcheck" # I appreciate the intent, but I'm not checking errors on fmt.Printf etc.
- "forbidigo" # fmt.Print* are fine for now
- "funlen" # We have inherited lots of long lines
- "gocyclo" # One day
- "godoclint" # There's lots to be done with documentation formatting, but not right now
- "godot" # Implicit full stops are ok
- "godox" # There will be TODOs
- "intrange" # Another thing that I like in theory, but am not prioritising right now
- "lll" # We have inherited lots of long lines
- "maintidx" # One day...
- "mnd" # I do not like magic numbers, but there are plenty inherited from upstream, so let's roll with them for now
- "nakedret" # Naked returns in long functions are kinda an ok tradeoff right now
- "noctx" # One day I will learn what a Context is, but that is not today
- "nonamedreturns" # Named returns seem a useful tradeoff for now - several functions that return ("output") many things, and names help
- "nlreturn" # Lots of false positives on C code that isn't a return
- "paralleltest" # One day, but let's have *working* tests first
- "perfsprint" # Performance optimisations, worth looking at, but not right now
- "prealloc" # One day, but not now
- "testpackage" # Noble intent, but right now we're doing all sorts of juggling with packages, so let's save this for later
- "varnamelen" # Noble intent, but we're inheriting lots of short variable names, and I'd like to stay close to upstream at first
- "whitespace" # I do not have the energy to deal with extraneous leading/trailing newlines right now
- "wrapcheck" # Error wrapping is the least of my concerns
- "wsl" # Avoid deprecation warning from enabling all
- "wsl_v5" # KG 2026-02-26 I don't have concrete data but it feels like wsl is giving me spurious edits/breakages - it might not be wsl, it might be something else, but it only started being an issue once I enabled wsl, so I'm disabling it again for the foreseeable
settings:
cyclop:
max-complexity: 750 # I sure wish this could be lower
depguard:
rules:
main:
list-mode: lax
deny:
- pkg: invalid
desc: Dummy deny because we need a non-empty list
exhaustive:
default-signifies-exhaustive: true # Soften the check for now...
gocognit:
min-complexity: 1792 # I sure wish this could be lower
goconst:
min-occurrences: 10
gocritic:
disabled-checks:
- captLocal # I agree, but I want to stay semi-consistent with upstream for now
- commentFormatting # Yes but later
- dupSubExpr # Too many false positives on cgo code
- elseif # I agree, but I'll fix it later
- ifElseChain # Reasonable but effort
- underef # Too many false positives on cgo code
gocyclo:
min-complexity: 60 # I sure wish this could be lower
gosec:
excludes:
- "G104" # Stop complaining about me not checking a fmt.Printf err via dw_printf...
- "G115" # I appreciate concerns about overflow via cast, but let's deal with them later
- "G404" # Weak RNGs are fine for our uses here, certainly for now(!)
- "G602" # "slice index out of range" checks that *may* be valid but it's hard to tell - if they're not false positives, they're niche issues
nestif:
min-complexity: 750 # There's lots of upstream complexity, so let's soft-disable this
revive:
rules:
- name: "var-naming"
disabled: true # There's going to be assorted naming conventions inherited from the original C for a while
staticcheck:
checks:
- all
- '-QF1001' # De Morgan's law *would* simplify some logic, but I'm copying upstream's style
- '-ST1000' # Default
- '-ST1003' # Default
- '-ST1016' # Default
- '-ST1020' # Default
- '-ST1021' # Default
- '-ST1022' # Default
- '-S1007' # Raw strings are good but I want to copy the pattern verbatim from upstream
wsl_v5:
disable:
- "decl"
issues:
max-issues-per-linter: 0
max-same-issues: 0
formatters:
enable:
- gci
- gofmt
- goimports
- golines
exclusions:
warn-unused: true
settings:
golines:
max-len: 200 # Long-ish is ok, let's try to minimise deviation from upstream