|
| 1 | +version: "2" |
1 | 2 | run: |
2 | | - deadline: 5m |
3 | | - |
| 3 | + modules-download-mode: readonly |
4 | 4 | linters: |
5 | 5 | enable: |
6 | | - - asasalint # check for pass []any as any in variadic func(...any) |
7 | | - - asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers |
| 6 | + - asasalint # Check for pass []any as any in variadic func(...any) |
| 7 | + - asciicheck # Checks that code identifiers do not have non-ASCII symbols |
8 | 8 | - bidichk # Checks for dangerous unicode character sequences |
9 | | - - containedctx # detects struct contained context.Context field |
10 | | - - contextcheck # check the function whether use a non-inherited context |
11 | | - - cyclop # checks function and package cyclomatic complexity |
12 | | - - decorder # check declaration order and count of types, constants, variables and functions |
13 | | - - depguard # Go linter that checks if package imports are in a list of acceptable packages |
14 | | - - dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f()) |
15 | | - - durationcheck # check for two durations multiplied together |
16 | | - - errcheck # checking for unchecked errors |
17 | | - - errname # Checks that errors are prefixed with the `Err` and error types are suffixed with the `Error` |
18 | | - - errorlint # finds code that will cause problems with the error wrapping scheme introduced in Go 1.13 |
19 | | - - exportloopref # checks for pointers to enclosing loop variables |
20 | | - - funlen # Tool for detection of long functions |
21 | | - - gci # controls golang package import order and makes it always deterministic |
| 9 | + - containedctx # Detects struct contained context.Context field |
| 10 | + - contextcheck # Check whether the function uses a non-inherited context |
| 11 | + - copyloopvar # Detects places where loop variables are copied |
| 12 | + - cyclop # Checks function and package cyclomatic complexity |
| 13 | + - decorder # Check declaration order of types, constants, variables and functions |
| 14 | + - dogsled # Checks assignments with too many blank identifiers |
| 15 | + - durationcheck # Check for two durations multiplied together |
| 16 | + - embeddedstructfieldcheck # Checks embedded struct field positioning and formatting |
| 17 | + - err113 # Check errors handling expressions |
| 18 | + - errcheck # Checks for unchecked errors in Go code |
| 19 | + - errname # Checks that sentinel errors are prefixed with Err |
| 20 | + - errorlint # Find code that will cause problems with error wrapping |
| 21 | + - funlen # Checks for long functions |
22 | 22 | - gocognit # Computes and checks the cognitive complexity of functions |
23 | 23 | - gocritic # Provides diagnostics that check for bugs, performance and style issues |
24 | 24 | - gocyclo # Computes and checks the cyclomatic complexity of functions |
25 | 25 | - godot # Check if comments end in a period |
26 | | - - goerr113 # Golang linter to check the errors handling expressions |
27 | | - - gosimple # Linter for Go source code that specializes in simplifying a code |
28 | | - - govet # reports suspicious constructs, such as Printf calls with wrong arguments |
| 26 | + - govet # Examines Go source code and reports suspicious constructs |
| 27 | + - grouper # Analyze expression groups |
| 28 | + - iface # Detect the incorrect use of interfaces |
29 | 29 | - ineffassign # Detects when assignments to existing variables are not used |
30 | | - - maintidx # measures the maintainability index of each function |
31 | | - - makezero # Finds slice declarations with non-zero initial length |
32 | | - - misspell # Finds commonly misspelled English words in comments |
33 | | - - nakedret # Finds naked returns in functions |
| 30 | + - intrange # Find places where for loops could use an integer range |
| 31 | + - ireturn # Accept Interfaces, Return Concrete Types |
| 32 | + - maintidx # Measures the maintainability index of each function |
| 33 | + - makezero # Find slice declarations with non-zero initial length |
| 34 | + - mirror # Reports wrong mirror patterns of bytes/strings usage |
| 35 | + - misspell # Finds commonly misspelled English words |
| 36 | + - modernize # Suggest simplifications using modern Go features |
| 37 | + - nakedret # Finds naked returns in functions longer than a maximum size |
34 | 38 | - nestif # Reports deeply nested if statements |
35 | | - - nilerr # Finds the code that returns nil even if it checks that the error is not nil |
36 | | - - nilnil # Checks that there is no simultaneous return of `nil` error and an invalid value |
37 | | - - prealloc # Finds slice declarations that could potentially be preallocated |
38 | | - - predeclared # find code that shadows one of Go's predeclared identifiers |
39 | | - - revive # drop-in replacement of golint |
40 | | - - staticcheck # drop-in replacement of go vet |
41 | | - - stylecheck # Stylecheck is a replacement for golint |
42 | | - - tenv # detects using os.Setenv instead of t.Setenv |
43 | | - - thelper # checks the consistency of test helpers |
44 | | - - tparallel # detects inappropriate usage of t.Parallel() |
45 | | - - typecheck # parses and type-checks Go code |
| 39 | + - nilerr # Finds code that returns nil even if it checks that error is not nil |
| 40 | + - nilnil # Checks that there is no simultaneous return of nil error and invalid value |
| 41 | + - noctx # Detects missing usage of context.Context |
| 42 | + - perfsprint # Checks that fmt.Sprintf can be replaced with a faster alternative |
| 43 | + - prealloc # Find slice declarations that could be pre-allocated |
| 44 | + - predeclared # Find code that shadows one of Go's predeclared identifiers |
| 45 | + - reassign # Checks that package variables are not reassigned |
| 46 | + - revive # Fast, configurable, extensible linter for Go |
| 47 | + - staticcheck # Set of rules from staticcheck |
| 48 | + - thelper # Detects test helpers which do not call t.Helper() |
| 49 | + - tparallel # Detects inappropriate usage of t.Parallel() |
46 | 50 | - unconvert # Remove unnecessary type conversions |
47 | 51 | - unparam # Reports unused function parameters |
48 | 52 | - unused # Checks Go code for unused constants, variables, functions and types |
49 | | - - usestdlibvars # detect the possibility to use variables/constants from the Go standard library |
50 | | - - wastedassign # finds wasted assignment statements |
51 | | - - whitespace # detects leading and trailing whitespace |
52 | | - |
53 | | -issues: |
54 | | - exclude-use-default: false |
55 | | - exclude-rules: |
56 | | - - linters: |
57 | | - - goerr113 |
58 | | - text: "do not define dynamic errors" |
| 53 | + - usestdlibvars # Detect the possibility to use variables/constants from stdlib |
| 54 | + - wastedassign # Finds wasted assignment statements |
| 55 | + - whitespace # Checks for unnecessary newlines |
| 56 | + - wrapcheck # Checks that errors returned from external packages are wrapped |
| 57 | + settings: |
| 58 | + whitespace: |
| 59 | + multi-if: true # Enforces newlines (or comments) after every multi-line if statement |
| 60 | + multi-func: true # Enforces newlines (or comments) after every multi-line function signature |
| 61 | + exclusions: |
| 62 | + rules: |
| 63 | + - linters: |
| 64 | + - err113 |
| 65 | + text: do not define dynamic errors |
| 66 | +formatters: |
| 67 | + enable: |
| 68 | + - gci # Check if code and import statements are formatted, with additional rules |
| 69 | + - gofmt # Check if the code is formatted according to 'gofmt' command |
| 70 | + - goimports # Checks if the code and import statements are formatted according to the 'goimports' command |
0 commit comments