-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy path.golangci.yaml
More file actions
85 lines (79 loc) · 1.9 KB
/
Copy path.golangci.yaml
File metadata and controls
85 lines (79 loc) · 1.9 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
# Run 'golangci-lint config verify' after any edit to this config file
version: "2"
# Disable all default linters and specify only ones we want below
linters:
default: none
enable:
- asciicheck
- bidichk
- bodyclose
- canonicalheader
- contextcheck
- copyloopvar
- dupl
- dupword
- errcheck
- errname
- forcetypeassert
- gocheckcompilerdirectives
- gocritic
- gosec
- govet
- ineffassign
- loggercheck
- misspell
- nilerr
- noctx
- nosprintfhostport
- staticcheck
- unconvert
- unparam
- unused
# Linters for tests
- ginkgolinter
# Defines a set of rules to ignore issues.
# It does not skip the analysis, and so does not ignore "typecheck" errors.
exclusions:
rules:
# Exclude some linters from running on tests files.
- path: "_test\\.go$|_mock\\.go$"
linters:
- errcheck
- gosec
- dupl
- goconst
- forcetypeassert
- unparam
# Run some linter only for test files by excluding its issues for everything else.
- path-except: "_test\\.go$|_mock\\.go$"
linters:
- ginkgolinter
# Per linter settings
settings:
gocritic:
disabled-checks:
- ifElseChain
- elseif
staticcheck:
checks:
- all
# Exclude checks:
- "-ST1000" # Package comment
- "-ST1003" # Variable names: Url -> URL
- "-ST1005" # Capitalized error messages
- "-QF1001" # De Morgan's law
- "-QF1003" # Switch enforce
- "-QF1008" # Embedded fields: r.Client.Get -> r.Get
formatters:
enable:
- gofmt
- goimports
issues:
# Maximum issues count per one linter.
# Set to 0 to disable.
# Default: 50
max-issues-per-linter: 50
# Maximum count of issues with the same text.
# Set to 0 to disable.
# Default: 3
max-same-issues: 5