-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.golangci.yml
84 lines (79 loc) · 1.82 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
83
84
# yaml-language-server: $schema=https://json.schemastore.org/golangci-lint
lintroller:
tier: "platinum"
# Linter settings
linters-settings:
dupl:
threshold: 100
errcheck:
check-blank: true
funlen:
lines: 500
statements: 50
gocyclo:
min-complexity: 25
goconst:
min-len: 3
min-occurrences: 3
lll:
line-length: 140
linters:
# Inverted configuration with enable-all and disable is not scalable during updates of golangci-lint.
disable-all: true
enable:
- bodyclose
- dogsled
- errcheck
- errorlint
- exhaustive # Checks exhaustiveness of enum switch statements.
- copyloopvar
- funlen
- gochecknoinits
- goconst
- gocritic
- gocyclo
- gofmt
- goimports
- revive
- gosec
- gosimple
- govet
- ineffassign
- lll
- misspell
- nakedret
- staticcheck
- typecheck
- unconvert
- unparam
- unused
- whitespace
issues:
exclude:
# We allow error shadowing
- 'declaration of "err" shadows declaration at'
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
# Exclude some linters from running on tests files.
- path: _test\.go
linters:
- gocyclo
- errcheck
- gosec
- funlen
- gochecknoglobals # Globals in test files are tolerated.
- goconst # Repeated consts in test files are tolerated.
# This rule is buggy and breaks on our `///Block` lines. Disable for now.
- linters:
- gocritic
text: "commentFormatting: put a space"
# This rule incorrectly flags nil references after assert.Assert(t, x != nil)
- path: _test\.go
text: "SA5011"
linters:
- staticcheck
- linters:
- lll
source: "^//go:generate "
output:
sort-results: true