-
Notifications
You must be signed in to change notification settings - Fork 1
/
.golangci.yaml
100 lines (95 loc) · 2.95 KB
/
.golangci.yaml
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
# Copied from cashapp/pranadb :)
run:
tests: true
timeout: 5m
max-same-issues: 50
modules-download-mode: readonly
skip-dirs:
output:
print-issued-lines: false
linters:
enable-all: true
disable:
- unparam
- maligned
- megacheck
- lll
- typecheck # `go build` catches this, and it doesn't currently work with Go 1.11 modules
- goimports # horrendously slow with go modules :(
- dupl # has never been actually useful
- gochecknoglobals
- gochecknoinits
- interfacer # author deprecated it because it provides bad suggestions
- funlen
- whitespace
- godox
- wsl
- dogsled
- gomnd
- gocognit
- testpackage
- nestif
- nolintlint
- goerr113
- godot
- gci # completely broken and unmaintained: https://github.com/daixiang0/gci/issues
# - gofumpt # a bit excessive
- exhaustivestruct
- nlreturn
- noctx # Nice idea, but don't have time. It would be good to re-enable and fix at some point.
- errorlint # Nice idea, but don't have time. It would be good to re-enable and fix at some point.
- forbidigo
- paralleltest
- prealloc # annoying
- golint # deprecated
- scopelint # deprecated
- wrapcheck # we should decide if we want to use this
- cyclop # duplicates gocyclo
- tagliatelle # snake case json!
linters-settings:
govet:
check-shadowing: true
use-installed-packages: true
dupl:
threshold: 100
goconst:
min-len: 8
min-occurrences: 3
gocyclo:
min-complexity: 20
gocritic:
disabled-checks:
- commentFormatting
- ifElseChain
disabled-tags:
- experimental
depguard:
list-type: blacklist
include-go-root: true
exhaustive:
default-signifies-exhaustive: true
issues:
max-per-linter: 0
max-same: 0
exclude-use-default: false
exclude-rules:
- path: _test\.go
linters:
- exportloopref
exclude:
# gosec overenthusiasm
- '^(G104|G204|G307|G306|G404):'
# Very commonly not checked.
- 'Error return value of .(.*\.Help|.*\.MarkFlagRequired|(os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*Unlock|.*Print(f|ln|)|os\.(Un)?Setenv). is not checked'
# Weird error only seen on Kochiku...
- 'internal error: no range for'
- 'exported method `.*\.(MarshalJSON|UnmarshalJSON|URN|Payload|GoString|Close|Provides|Requires|ExcludeFromHash|MarshalText|UnmarshalText|Description|Check|Poll|Severity)` should have comment or be unexported'
- 'composite literal uses unkeyed fields'
- 'declaration of "err" shadows declaration'
- 'by other packages, and that stutters'
- 'Potential file inclusion via variable'
- 'at least one file in a package should have a package comment'
# errors.As() is error-prone and difficult to use.
- 'Use errors.As to check for specific errors'
- 'should have comment.* or be unexported' # Disabled until we start deciding to write function docs...
- "don't use leading k in Go names"