-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
84 lines (81 loc) · 4.51 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
run:
timeout: 5m
modules-download-mode: readonly
linters:
enable:
- asasalint # check for pass []any as any in variadic func(...any)
- asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers
- bidichk # Checks for dangerous unicode character sequences
- containedctx # detects struct contained context.Context field
- contextcheck # check the function whether use a non-inherited context
- copyloopvar # detects places where loop variables are copied
- cyclop # checks function and package cyclomatic complexity
- decorder # check declaration order and count of types, constants, variables and functions
- dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f())
- durationcheck # check for two durations multiplied together
- err113 # Golang linter to check the errors handling expressions
- errcheck # checking for unchecked errors
- errname # Checks that errors are prefixed with the `Err` and error types are suffixed with the `Error`
- errorlint # finds code that will cause problems with the error wrapping scheme introduced in Go 1.13
- funlen # Tool for detection of long functions
- gci # controls golang package import order and makes it always deterministic
- gocheckcompilerdirectives # Checks that go compiler directive comments (//go:) are valid
- gocognit # Computes and checks the cognitive complexity of functions
- goconst # Finds repeated strings that could be replaced by a constant
- gocritic # Provides diagnostics that check for bugs, performance and style issues
- gocyclo # Computes and checks the cyclomatic complexity of functions
- godot # Check if comments end in a period
- gofmt # checks whether code was gofmt-ed
- goimports # Check import statements are formatted according to the 'goimport' command
- gosimple # Linter for Go source code that specializes in simplifying a code
- gosmopolitan # Report certain i18n/l10n anti-patterns in your Go codebase
- govet # reports suspicious constructs, such as Printf calls with wrong arguments
- grouper # An analyzer to analyze expression groups
- ineffassign # Detects when assignments to existing variables are not used
- intrange # finds places where for loops could make use of an integer range.
- maintidx # measures the maintainability index of each function
- makezero # Finds slice declarations with non-zero initial length
- mirror # reports wrong mirror patterns of bytes/strings usage
- misspell # Finds commonly misspelled English words in comments
- nakedret # Finds naked returns in functions
- nestif # Reports deeply nested if statements
- nilerr # Finds the code that returns nil even if it checks that the error is not nil
- nilnil # Checks that there is no simultaneous return of `nil` error and an invalid value
- perfsprint # Checks that fmt.Sprintf can be replaced with a faster alternative
- prealloc # Finds slice declarations that could potentially be preallocated
- predeclared # find code that shadows one of Go's predeclared identifiers
- reassign # Checks that package variables are not reassigned
- revive # drop-in replacement of golint
- staticcheck # drop-in replacement of go vet
- stylecheck # Stylecheck is a replacement for golint
- tenv # detects using os.Setenv instead of t.Setenv
- thelper # checks the consistency of test helpers
- tparallel # detects inappropriate usage of t.Parallel()
- typecheck # 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
- usestdlibvars # detect the possibility to use variables/constants from the Go standard library
- wastedassign # finds wasted assignment statements
- whitespace # detects leading and trailing whitespace
- wrapcheck # Checks that errors returned from external packages are wrapped
linters-settings:
cyclop:
max-complexity: 15
godot:
period: false
nestif:
min-complexity: 8
revive:
rules:
- name: dot-imports
disabled: true
whitespace:
multi-if: true # Enforces newlines (or comments) after every multi-line if statement
multi-func: true # Enforces newlines (or comments) after every multi-line function signature
issues:
exclude-use-default: false
exclude-rules:
- linters:
- err113
text: "do not define dynamic errors"