-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.golangci.yml
100 lines (90 loc) · 2.96 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
run:
timeout: 5m
# include test files
tests: true
linters:
enable-all: true
disable:
- exhaustivestruct # The owner seems to have abandoned the linter. Replaced by exhaustruct.
- ifshort # The repository of the linter has been deprecated by the owner.
- maligned # The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'.
- interfacer # The repository of the linter has been archived by the owner.
- deadcode # The owner seems to have abandoned the linter. Replaced by unused.
- golint # The repository of the linter has been archived by the owner. Replaced by revive.
- varcheck # The owner seems to have abandoned the linter. Replaced by unused.
- structcheck # The owner seems to have abandoned the linter. Replaced by unused.
- nosnakecase # The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming).
- scopelint # The repository of the linter has been deprecated by the owner. Replaced by exportloopref.
- varnamelen # useless in the scope of this project
# Run all the linters from enabled linters set
fast: false
issues:
# skipping non-go dirs
exclude-dirs:
- bin
- config
- debian
- docs
- scripts
- tests
include:
- EXC0001 # Check return values of os funcs
- EXC0004 # govet
- EXC0005 # C-style breaks
exclude-rules:
- linters:
- ireturn
text: "returns generic interface"
- linters:
- lll
source: "^//go:generate "
- linters:
- errcheck
source: "defer\\s+[^\\s]+.Close()"
- linters:
- revive
text: "unexported-return: exported func .+ returns unexported type .+, which can be annoying to use"
- path: cmd/[^/]+/.+\.go
text: exitAfterDefer
# Exclude some linters from running on tests files.
- path: _test\.go
linters:
- gocyclo
- errcheck
- dupl
- gosec
- gochecknoglobals
- exhaustruct
- ireturn
- funlen
- unparam
- lll
linters-settings:
gci:
# Section configuration to compare against.
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- prefix(github.com/easyp-tech) # Custom section: groups all imports with the specified Prefix.
skip-generated: false
# Enable custom order of sections.
# If true, make the section order the same as the order of sections.
custom-order: true
depguard:
rules:
main:
files:
- !$test
allow:
- $gostd
cmd:
files:
- "cmd/*/*.go"
allow:
- $gostd
tests:
files:
- $test
allow:
- $gostd
- github.com/stretchr/testify