-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.golangci.yml
More file actions
70 lines (70 loc) · 4.02 KB
/
Copy path.golangci.yml
File metadata and controls
70 lines (70 loc) · 4.02 KB
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
version: "2"
run:
modules-download-mode: readonly
linters:
enable:
- asasalint # Check for pass []any as any in variadic func(...any)
- asciicheck # Checks that code identifiers do not have non-ASCII symbols
- bidichk # Checks for dangerous unicode character sequences
- containedctx # Detects struct contained context.Context field
- contextcheck # Check whether the function uses a non-inherited context
- copyloopvar # Detects places where loop variables are copied
- cyclop # Checks function and package cyclomatic complexity
- decorder # Check declaration order of types, constants, variables and functions
- dogsled # Checks assignments with too many blank identifiers
- durationcheck # Check for two durations multiplied together
- embeddedstructfieldcheck # Checks embedded struct field positioning and formatting
- err113 # Check errors handling expressions
- errcheck # Checks for unchecked errors in Go code
- errname # Checks that sentinel errors are prefixed with Err
- errorlint # Find code that will cause problems with error wrapping
- funlen # Checks for long functions
- gocognit # Computes and checks the cognitive complexity of functions
- 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
- govet # Examines Go source code and reports suspicious constructs
- grouper # Analyze expression groups
- iface # Detect the incorrect use of interfaces
- ineffassign # Detects when assignments to existing variables are not used
- intrange # Find places where for loops could use an integer range
- ireturn # Accept Interfaces, Return Concrete Types
- maintidx # Measures the maintainability index of each function
- makezero # Find slice declarations with non-zero initial length
- mirror # Reports wrong mirror patterns of bytes/strings usage
- misspell # Finds commonly misspelled English words
- modernize # Suggest simplifications using modern Go features
- nakedret # Finds naked returns in functions longer than a maximum size
- nestif # Reports deeply nested if statements
- nilerr # Finds code that returns nil even if it checks that error is not nil
- nilnil # Checks that there is no simultaneous return of nil error and invalid value
- noctx # Detects missing usage of context.Context
- perfsprint # Checks that fmt.Sprintf can be replaced with a faster alternative
- prealloc # Find slice declarations that could be pre-allocated
- predeclared # Find code that shadows one of Go's predeclared identifiers
- reassign # Checks that package variables are not reassigned
- revive # Fast, configurable, extensible linter for Go
- staticcheck # Set of rules from staticcheck
- thelper # Detects test helpers which do not call t.Helper()
- tparallel # Detects inappropriate usage of t.Parallel()
- 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 stdlib
- wastedassign # Finds wasted assignment statements
- whitespace # Checks for unnecessary newlines
- wrapcheck # Checks that errors returned from external packages are wrapped
settings:
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
exclusions:
rules:
- linters:
- err113
text: do not define dynamic errors
formatters:
enable:
- gci # Check if code and import statements are formatted, with additional rules
- gofmt # Check if the code is formatted according to 'gofmt' command
- goimports # Checks if the code and import statements are formatted according to the 'goimports' command