|
1 | | -linters-settings: |
2 | | - gocritic: |
3 | | - enabled-tags: |
4 | | - - diagnostic |
5 | | - - experimental |
6 | | - - opinionated |
7 | | - - performance |
8 | | - - style |
9 | | - disabled-checks: |
10 | | - - octalLiteral |
11 | | - gocyclo: |
12 | | - min-complexity: 15 |
13 | | - revive: |
14 | | - # see https://github.com/mgechev/revive#available-rules for details. |
15 | | - ignore-generated-header: true |
16 | | - severity: warning |
17 | | - rules: |
18 | | - - name: blank-imports |
19 | | - - name: context-as-argument |
20 | | - - name: context-keys-type |
21 | | - - name: dot-imports |
22 | | - - name: error-return |
23 | | - - name: error-strings |
24 | | - - name: error-naming |
25 | | - - name: errorf |
26 | | - - name: exported |
27 | | - - name: indent-error-flow |
28 | | - - name: if-return |
29 | | - - name: increment-decrement |
30 | | - - name: var-naming |
31 | | - - name: var-declaration |
32 | | - - name: package-comments |
33 | | - - name: range |
34 | | - - name: receiver-naming |
35 | | - - name: time-naming |
36 | | - - name: unexported-return |
37 | | - - name: indent-error-flow |
38 | | - - name: errorf |
39 | | - - name: empty-block |
40 | | - - name: superfluous-else |
41 | | - - name: struct-tag |
42 | | - - name: unused-parameter |
43 | | - - name: unused-receiver |
44 | | - - name: unreachable-code |
45 | | - - name: redefines-builtin-id |
| 1 | +version: "2" |
| 2 | +run: |
| 3 | + modules-download-mode: readonly |
| 4 | + tests: true |
46 | 5 | linters: |
47 | | - # please, do not use `enable-all`: it's deprecated and will be removed soon. |
48 | | - # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint |
49 | | - disable-all: true |
| 6 | + default: none |
50 | 7 | enable: |
51 | | - - bodyclose # checks whether HTTP response body is closed successfully [fast: false, auto-fix: false] |
52 | | - - dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f()) [fast: true, auto-fix: false] |
53 | | - - errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases [fast: false, auto-fix: false] |
54 | | - - errorlint # errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13. [fast: false, auto-fix: false] |
55 | | - - exhaustive # check exhaustiveness of enum switch statements [fast: false, auto-fix: false] |
56 | | - - gochecknoinits # Checks that no init functions are present in Go code [fast: true, auto-fix: false] |
57 | | - - gocritic # Provides many diagnostics that check for bugs, performance and style issues. [fast: false, auto-fix: false] |
58 | | - - gocyclo # Computes and checks the cyclomatic complexity of functions [fast: true, auto-fix: false] |
59 | | - - godot # Check if comments end in a period [fast: true, auto-fix: true] |
60 | | - - gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification [fast: true, auto-fix: true] |
61 | | - - goimports # Goimports does everything that gofmt does. Additionally it checks unused imports [fast: true, auto-fix: true] |
62 | | - - goprintffuncname # Checks that printf-like functions are named with `f` at the end [fast: true, auto-fix: false] |
63 | | - - gosec # Inspects source code for security problems [fast: false, auto-fix: false] |
64 | | - - gosimple # Linter for Go source code that specializes in simplifying a code [fast: false, auto-fix: false] |
65 | | - - govet # Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string [fast: false, auto-fix: false] |
66 | | - - ineffassign # Detects when assignments to existing variables are not used [fast: true, auto-fix: false] |
67 | | - - misspell # Finds commonly misspelled English words in comments [fast: true, auto-fix: true] |
68 | | - - nakedret # Finds naked returns in functions greater than a specified function length [fast: true, auto-fix: false] |
69 | | - - nolintlint # Reports ill-formed or insufficient nolint directives [fast: true, auto-fix: false] |
70 | | - - revive # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint. [fast: false, auto-fix: false] |
71 | | - - rowserrcheck # checks whether Err of rows is checked successfully [fast: false, auto-fix: false] |
72 | | - - staticcheck # Staticcheck is a go vet on steroids, applying a ton of static analysis checks [fast: false, auto-fix: false] |
73 | | - - stylecheck # Stylecheck is a replacement for golint [fast: false, auto-fix: false] |
74 | | - - thelper # thelper detects golang test helpers without t.Helper() call and checks the consistency of test helpers [fast: false, auto-fix: false] |
75 | | - - typecheck # Like the front-end of a Go compiler, parses and type-checks Go code [fast: false, auto-fix: false] |
76 | | - - unconvert # Remove unnecessary type conversions [fast: false, auto-fix: false] |
77 | | - - unparam # Reports unused function parameters [fast: false, auto-fix: false] |
78 | | - - unused # Checks Go code for unused constants, variables, functions and types [fast: false, auto-fix: false] |
79 | | - - whitespace # Tool for detection of leading and trailing whitespace [fast: true, auto-fix: true] |
| 8 | + - bodyclose |
| 9 | + - dogsled |
| 10 | + - errcheck |
| 11 | + - errorlint |
| 12 | + - exhaustive |
| 13 | + - gochecknoinits |
| 14 | + - gocritic |
| 15 | + - gocyclo |
| 16 | + - godot |
| 17 | + - goprintffuncname |
| 18 | + - gosec |
| 19 | + - govet |
| 20 | + - ineffassign |
| 21 | + - misspell |
| 22 | + - nakedret |
| 23 | + - nolintlint |
| 24 | + - revive |
| 25 | + - rowserrcheck |
| 26 | + - staticcheck |
| 27 | + - thelper |
| 28 | + - unconvert |
| 29 | + - unparam |
| 30 | + - unused |
| 31 | + - whitespace |
80 | 32 |
|
81 | | - # don't enable: |
82 | | -# - asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers [fast: true, auto-fix: false] |
83 | | -# - cyclop # checks function and package cyclomatic complexity [fast: false, auto-fix: false] |
84 | | -# - deadcode # Finds unused code [fast: false, auto-fix: false] |
85 | | -# - dupl # Tool for code clone detection [fast: true, auto-fix: false] |
86 | | -# - durationcheck # check for two durations multiplied together [fast: false, auto-fix: false] |
87 | | -# - exhaustivestruct # Checks if all struct's fields are initialized [fast: false, auto-fix: false] |
88 | | -# - forbidigo # Forbids identifiers [fast: true, auto-fix: false] |
89 | | -# - forcetypeassert # finds forced type assertions [fast: true, auto-fix: false] |
90 | | -# - funlen # Tool for detection of long functions [fast: true, auto-fix: false] |
91 | | -# - gci # Gci control golang package import order and make it always deterministic. [fast: true, auto-fix: true] |
92 | | -# - gochecknoglobals # check that no global variables exist [fast: true, auto-fix: false] |
93 | | -# - gocognit # Computes and checks the cognitive complexity of functions [fast: true, auto-fix: false] |
94 | | -# - goconst # Finds repeated strings that could be replaced by a constant [fast: true, auto-fix: false] |
95 | | -# - godox # Tool for detection of FIXME, TODO and other comment keywords [fast: true, auto-fix: false] |
96 | | -# - gomnd # An analyzer to detect magic numbers. [fast: true, auto-fix: false] |
97 | | -# - goerr113 # Golang linter to check the errors handling expressions [fast: false, auto-fix: false] |
98 | | -# - gofumpt # Gofumpt checks whether code was gofumpt-ed. [fast: true, auto-fix: true] |
99 | | -# - goheader # Checks is file header matches to pattern [fast: true, auto-fix: false] |
100 | | -# - gomoddirectives # Manage the use of 'replace', 'retract', and 'excludes' directives in go.mod. [fast: true, auto-fix: false] |
101 | | -# - gomodguard # Allow and block list linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations. [fast: true, auto-fix: false] |
102 | | -# - importas # Enforces consistent import aliases [fast: false, auto-fix: false] |
103 | | -# - interfacer # Linter that suggests narrower interface types [fast: false, auto-fix: false] |
104 | | -# - lll # Reports long lines [fast: true, auto-fix: false] |
105 | | -# - makezero # Finds slice declarations with non-zero initial length [fast: false, auto-fix: false] |
106 | | -# - maligned # Tool to detect Go structs that would take less memory if their fields were sorted [fast: false, auto-fix: false] |
107 | | -# - nestif # Reports deeply nested if statements [fast: true, auto-fix: false] |
108 | | -# - nilerr # Finds the code that returns nil even if it checks that the error is not nil. [fast: false, auto-fix: false] |
109 | | -# - nlreturn # nlreturn checks for a new line before return and branch statements to increase code clarity [fast: true, auto-fix: false] |
110 | | -# - noctx # noctx finds sending http request without context.Context [fast: false, auto-fix: false] |
111 | | -# - paralleltest # paralleltest detects missing usage of t.Parallel() method in your Go test [fast: true, auto-fix: false] |
112 | | -# - prealloc # Finds slice declarations that could potentially be preallocated [fast: true, auto-fix: false] |
113 | | -# - predeclared # find code that shadows one of Go's predeclared identifiers [fast: true, auto-fix: false] |
114 | | -# - promlinter # Check Prometheus metrics naming via promlint [fast: true, auto-fix: false] |
115 | | -# - scopelint # Scopelint checks for unpinned variables in go programs [fast: true, auto-fix: false] |
116 | | -# - sqlclosecheck # Checks that sql.Rows and sql.Stmt are closed. [fast: false, auto-fix: false] |
117 | | -# - structcheck # Finds unused struct fields [fast: false, auto-fix: false] |
118 | | -# - testpackage # linter that makes you use a separate _test package [fast: true, auto-fix: false] |
119 | | -# - tparallel # tparallel detects inappropriate usage of t.Parallel() method in your Go test codes [fast: false, auto-fix: false] |
120 | | -# - wastedassign # wastedassign finds wasted assignment statements. [fast: false, auto-fix: false] |
121 | | -# - wrapcheck # Checks that errors returned from external packages are wrapped [fast: false, auto-fix: false] |
122 | | -# - wsl # Whitespace Linter - Forces you to use empty lines! [fast: true, auto-fix: false] |
123 | | -# - varcheck # Finds unused global variables and constants [fast: false, auto-fix: false] |
124 | | -# - ifshort # Checks that your code uses short syntax for if-statements whenever possible [fast: true, auto-fix: false] |
| 33 | + settings: |
| 34 | + gocritic: |
| 35 | + enabled-tags: |
| 36 | + - diagnostic |
| 37 | + - experimental |
| 38 | + - opinionated |
| 39 | + - performance |
| 40 | + - style |
| 41 | + disabled-checks: |
| 42 | + - octalLiteral |
| 43 | + gocyclo: |
| 44 | + min-complexity: 15 |
| 45 | + revive: |
| 46 | + severity: warning |
| 47 | + rules: |
| 48 | + - name: blank-imports |
| 49 | + - name: context-as-argument |
| 50 | + - name: context-keys-type |
| 51 | + - name: dot-imports |
| 52 | + - name: error-return |
| 53 | + - name: error-strings |
| 54 | + - name: error-naming |
| 55 | + - name: errorf |
| 56 | + - name: exported |
| 57 | + - name: indent-error-flow |
| 58 | + - name: if-return |
| 59 | + - name: increment-decrement |
| 60 | + - name: var-naming |
| 61 | + - name: var-declaration |
| 62 | + - name: package-comments |
| 63 | + - name: range |
| 64 | + - name: receiver-naming |
| 65 | + - name: time-naming |
| 66 | + - name: unexported-return |
| 67 | + - name: empty-block |
| 68 | + - name: superfluous-else |
| 69 | + - name: struct-tag |
| 70 | + - name: unused-parameter |
| 71 | + - name: unused-receiver |
| 72 | + - name: unreachable-code |
| 73 | + - name: redefines-builtin-id |
| 74 | + govet: |
| 75 | + enable-all: true |
| 76 | + misspell: |
| 77 | + locale: US |
| 78 | + exclusions: |
| 79 | + generated: lax |
| 80 | + presets: |
| 81 | + - comments |
| 82 | + - common-false-positives |
| 83 | + - legacy |
| 84 | + - std-error-handling |
| 85 | +formatters: |
| 86 | + enable: |
| 87 | + - gofmt |
| 88 | + - goimports |
0 commit comments