-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.golangci.yml
74 lines (72 loc) · 2.8 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
run:
issues-exit-code: 0
linters:
disable-all: true
enable:
- revive
- gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification
- gosimple # Linter for Go source code that specializes in simplifying a code
- govet # Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
- errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases
- ineffassign # Detects when assignments to existing variables are not used
- staticcheck # Staticcheck is a go vet on steroids, applying a ton of static analysis checks
- typecheck # Like the front-end of a Go compiler, parses and type-checks Go code
- unconvert # Remove unnecessary type conversions
- unparam # Reports unused function parameters
- unused # Checks Go code for unused constants, variables, functions and types
- dupl # Tool for code clone detection
- goconst # Finds repeated strings that could be replaced by a constant
- gocyclo # Computes and checks the cyclomatic complexity of functions
- depguard # Go linter that checks if package imports are in a list of acceptable packages
- misspell # Finds commonly misspelled English words in comments
- nakedret # Finds naked returns in functions greater than a specified function length
- prealloc # Finds slice declarations that could potentially be preallocated
- exportloopref
- gocritic # The most opinionated Go source code linter
- gochecknoinits # Checks that no init functions are present in Go code
- gochecknoglobals # Checks that no globals are present in Go code
- gosec # Inspects source code for security problems
- makezero
- nilerr
- nlreturn
- noctx
- nolintlint
- predeclared
- promlinter
- rowserrcheck
- sqlclosecheck
- stylecheck
- thelper
- whitespace
- asciicheck
- bodyclose
- depguard
- dogsled
- durationcheck
- errorlint
- exportloopref
- forbidigo
- forcetypeassert
#- wsl
#- nestif
##- cyclop
##- gocognit
linters-settings:
govet:
check-shadowing: true
#enable:
#- fieldalignment
enable-all: false
cyclop:
# the maximal code complexity to report
max-complexity: 10
# the maximal average package complexity. If it's higher than 0.0 (float) the check is enabled (default 0.0)
package-average: 0.0
# should ignore tests (default false)
skip-tests: false
gocognit:
# minimal code complexity to report, 30 by default (but we recommend 10-20)
min-complexity: 10
nestif:
# minimal complexity of if statements to report, 5 by default
min-complexity: 5