-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path.golangci.yml
More file actions
109 lines (109 loc) · 3.13 KB
/
Copy path.golangci.yml
File metadata and controls
109 lines (109 loc) · 3.13 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
version: "2"
linters:
default: all
disable:
- depguard
- funlen
- gomoddirectives # mono-repo, multi-modules (docs/examples): local replace directives are needed for proper releasing
- goconst # disabled, perhaps temporarily as this linter has become way too pick and noisy
- godox
- gomoddirectives
- gomodguard
- gomodguard_v2
- exhaustruct
- ireturn # not suited to the design of this repo
- nlreturn
- nonamedreturns
- noinlineerr
- paralleltest
- recvcheck
- testpackage
- thelper
- tparallel
- varnamelen
- whitespace
- wrapcheck
- wsl
- wsl_v5
settings:
dupl:
threshold: 200
goconst:
min-len: 2
min-occurrences: 3
cyclop:
max-complexity: 30
gocyclo:
min-complexity: 30
gocognit:
min-complexity: 35
exhaustive:
default-signifies-exhaustive: true
default-case-required: true
lll:
line-length: 180
maintidx:
under: 15
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- third_party$
- builtin$
- examples$
# Copied verbatim from the Go distribution (BSD-3-Clause) so it stays
# diffable against upstream. Reformatting it to our house style would
# make every future re-sync a manual merge.
- internal/packages/list/pkgpattern.*\.go$
rules:
# hack/ holds developer tools, not library code: printing a report to
# stdout is what they are for.
- path: hack/
linters:
- forbidigo
# cmd/genspec-tui is a bubbletea front-end. These four disagree with the
# shape of TUI code rather than with the code itself, and each fires often
# enough (102 between them) that //nolint would be the scattering this
# repo's linting rule tells us to avoid. Scoped by path so the library
# keeps all four.
- path: cmd/genspec-tui/
linters:
# Layout arithmetic, where the number IS the explanation: w-2 is the
# two border columns, h-3 is border plus title row.
- mnd
# Key, mouse and message switches read open-ended INPUT, not a closed
# domain. Falling through to the code after the switch is the
# behaviour, so a required `default:` would be an empty statement
# asserting nothing. The scanner's go/types switches still get this.
- exhaustive
# clamp/clampInt keep a general (v, lo, hi) signature though every
# call site happens to pass lo=0.
- unparam
formatters:
enable:
- gofmt
- goimports
- gofumpt
exclusions:
generated: lax
paths:
- fixtures
- testdata
- third_party$
- builtin$
- examples$
# As above: derived from the Go distribution, kept byte-comparable.
- internal/packages/list/pkgpattern.*\.go$
issues:
# Maximum issues count per one linter.
# Set to 0 to disable.
# Default: 50
max-issues-per-linter: 0
# Maximum count of issues with the same text.
# Set to 0 to disable.
# Default: 3
max-same-issues: 0