-
Notifications
You must be signed in to change notification settings - Fork 378
/
.golangci.yml
82 lines (79 loc) · 2.54 KB
/
.golangci.yml
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
run:
tests: true
build-tags:
- integration
- fuzz
# fail if go.mod needs changing
modules-download-mode: readonly
linters-settings:
govet:
enable-all: true
disable:
- composites # same as exhaustruct below
- fieldalignment
asasalint:
exclude:
- glog\.Infof
linters:
presets:
- bugs
- error
- format
- import
- module
- performance
- test
- unused
- metalinter
enable:
- exportloopref
# A general rule is if the lint author can't be bothered supplying automated
# fixes for obvious lint warnings, I'm not bothered using their tool.
disable:
- cyclop # boo cyclomatic complexity
- dupl # exclude test code
- depguard
- errcheck # handled by gosec, lots of false posi
- exhaustive # this false-positives for switches with a default
- exhaustruct # above, renamed
- forbidigo # exclude non prod tools
- forcetypeassert # too many at the moment
- funlen # My tests will be as long as they need to be thanks
- gci
- gochecknoglobals # Flags are fine, as are test tables.
- gochecknoinits # How dare you tell me not to use inits.
- gocognit # boo cyclomatic complexity
- gocyclo # boo cyclomatic complexity
- godox # TODOs are fine
- gomnd # magic numbers in test tables are fine actually
- gosec # run independently
- lll # go says long lines are ok, and this is trivially automatable
- musttag # don't agree with the premise
- nakedret # weird thing to report on
- nestif # cognitive complexity
- nlreturn # Not a fan of this one, looks messy
- nolintlint # broken on gocritic
- paralleltest # i had a good reason for this
- perfsprint
- testpackage # need to test internal methods
- unparam # too noisy
- whitespace # broken by goyacc
- wrapcheck # not sure this is necessary
- wsl # wsl doesn't explain any of its recommendations
issues:
# Show everything.
max-issues-per-linter: 0
max-same-issues: 0
exclude-use-default: true
exclude:
# `gofix` should fix this if it really cared
- 'composite literal uses unkeyed fields'
# I like common patterns of shadowing: ctx and err
- 'declaration of "ctx" shadows declaration'
- 'declaration of "err" shadows declaration'
# goyacc generated error in three locations
- 'this value of `mtailDollar.* is never used'
# Incorrectly reports undeclared in same package
- "undeclared name:"
# Disagree with capitalisation of identifier names
- "ST1003:"