-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy path.golangci.yml
121 lines (105 loc) · 3 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
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
110
111
112
113
114
115
116
117
118
119
120
121
# golangci-lint configuration file
# see: https://github.com/golangci/golangci/wiki/Configuration
# Options for analysis running
run:
# Which dirs to skip: they won't be analyzed;
# Can use regexp here: generated.*, regexp is applied on full path;
# Default value is empty list, but next dirs are always skipped independently
# From this option's value:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
skip-dirs:
- bin
skip-files:
- ".*_test.go"
timeout: 10m
# All available settings of specific linters
linters-settings:
govet:
# Report about shadowed variables
check-shadowing: true
golint:
# Minimal confidence for issues, default is 0.8
min-confidence: 0
gocyclo:
# Minimal code complexity to report, 30 by default (but we recommend 10-20)
min-complexity: 30
dupl:
# Tokens count to trigger issue, 150 by default
threshold: 100
misspell:
# Correct spellings using locale preferences for US or UK.
# Default is to use a neutral variety of English.
# Setting locale to US will correct the British spelling of 'colour' to 'color'.
locale: US
# - colour
nakedret:
# Make an issue if func has more lines of code than this setting and it has naked returns; default is 30
max-func-lines: 0
gocritic:
# Which checks should be disabled; can't be combined with 'enabled-checks'; default is empty
disabled-checks:
- whyNoLint
- wrapperFunc
- ifElseChain
- paramTypeCombine
- singleCaseSwitch
- unnamedResult
- hugeParam
- octalLiteral
- commentedOutCode
# Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint` run to see all tags and checks.
# Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags".
enabled-tags:
- performance
- style
- experimental
# Settings for enabling and disabling linters
linters:
disable-all: true
enable:
- bodyclose
- deadcode
# - depguard # disable this temporarily until we confirm and create an allow-list of the imported modules
- dogsled
- exportloopref
- errcheck
- gocritic
- gocyclo
- gofmt
- gofumpt
- goimports
- goprintffuncname
- gosec
- gosimple
- govet
- ifshort
- ineffassign
- misspell
- nakedret
- nolintlint
- rowserrcheck
- staticcheck
- structcheck
- stylecheck
- typecheck
- unconvert
- unused
- varcheck
- whitespace
# Configuration of issue rules
issues:
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
# Exclude shadow checking on the variable named err
- text: "shadow: declaration of \"err\""
linters:
- govet
# Exclude godox check for TODOs, FIXMEs, and BUGs
- text: "Line contains TODO/BUG/FIXME:"
linters:
- godox
# Exclude some linters from running on tests files
- path: _test\.go
linters:
- gocyclo
- goconst