-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.golangci.yml
96 lines (95 loc) · 3.46 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
## A good ref for this: https://gist.github.com/maratori/47a4d00457a92aa426dbd48a18776322
run:
timeout: 5m
tests: true
linters:
enable:
- asasalint # checks for pass []any as any in variadic func(...any)
- asciicheck # checks that your code does not contain non-ASCII identifiers
- bidichk # checks for dangerous unicode character sequences
- bodyclose
- containedctx
- decorder # checks declaration order and count of types, constants, variables and functions
- dogsled
- dupword # checks for duplicate words in the source code
- durationcheck # checks for two durations multiplied together
- errcheck
- errname
- errorlint
- exportloopref # checks for pointers to enclosing loop variables
- gci
- gochecknoinits # checks that no init functions are present in Go code
- gocritic
- gomnd
- gosimple
- govet
- importas # enforces consistent import aliases
- ineffassign
- loggercheck
- makezero # finds slice declarations with non-zero initial length
- mirror
- misspell
- musttag # enforces field tags in (un)marshaled structs
- nakedret
- nestif # reports deeply nested if statements
- nilerr # finds the code that returns nil even if it checks that the error is not nil
- noctx # finds sending http request without context.Context
- nolintlint # reports ill-formed or insufficient nolint directives
- predeclared # finds code that shadows one of Go's predeclared identifiers
- promlinter
- reassign # checks that package variables are not reassigned
- revive # fast, configurable, extensible, flexible, and beautiful linter for Go, drop-in replacement of golint
- staticcheck
- stylecheck
- tenv
- thelper # detects golang test helpers without t.Helper() call and checks the consistency of test helpers
- unconvert # removes unnecessary type conversions
- unparam # reports unused function parameters
- unused
- usestdlibvars # detects the possibility to use variables/constants from the Go standard library
- wastedassign # finds wasted assignment statements
- whitespace # detects leading and trailing whitespace
linters-settings:
gci:
skip-generated: true
custom-order: true
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/jjti)
gocritic:
settings:
captLocal:
# Whether to restrict checker to params only.
# Default: true
paramsOnly: false
underef:
# Whether to skip (*x).method() calls where x is a pointer receiver.
# Default: true
skipRecvDeref: false
govet:
enable-all: true
disable:
- fieldalignment # too strict
- shadow # bunch of false positive, doesn't realize when we return from a func
misspell:
locale: US
nakedret:
max-func-lines: 0
nestif:
# Minimal complexity of if statements to report.
# Default: 5
min-complexity: 4
nolintlint:
# Enable to require an explanation of nonzero length after each nolint directive.
# Default: false
require-explanation: true
stylecheck:
checks: ["all"]
issues:
include:
- EXC0001 # Error return value of x is not checked
- EXC0013 # package comment should be of the form "(.+)...
- EXC0014 # comment on exported (.+) should be of the form "(.+)..."
exclude:
- ifElseChain