|
1 | | -linters-settings: |
2 | | - gocritic: |
3 | | - enabled-tags: |
4 | | - - diagnostic |
5 | | - - experimental |
6 | | - - opinionated |
7 | | - - performance |
8 | | - - style |
9 | | - govet: |
10 | | - enable: |
11 | | - - shadow |
12 | | - |
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: defer |
22 | | - - name: dot-imports |
23 | | - - name: error-return |
24 | | - - name: error-strings |
25 | | - - name: error-naming |
26 | | - - name: early-return |
27 | | - - name: errorf |
28 | | - - name: exported |
29 | | - - name: import-shadowing |
30 | | - - name: indent-error-flow |
31 | | - - name: if-return |
32 | | - - name: increment-decrement |
33 | | - - name: var-naming |
34 | | - - name: var-declaration |
35 | | - - name: package-comments |
36 | | - - name: range |
37 | | - - name: receiver-naming |
38 | | - - name: time-naming |
39 | | - - name: unexported-return |
40 | | - - name: indent-error-flow |
41 | | - - name: errorf |
42 | | - - name: empty-block |
43 | | - - name: superfluous-else |
44 | | - - name: struct-tag |
45 | | - - name: unused-parameter |
46 | | - - name: unreachable-code |
47 | | - - name: redefines-builtin-id |
48 | | - - name: unused-receiver |
49 | | - - name: constant-logical-expr |
50 | | - - name: confusing-naming |
51 | | - - name: unnecessary-stmt |
52 | | - - name: use-any |
53 | | - - name: imports-blocklist |
54 | | - arguments: |
55 | | - - "github.com/pkg/errors" |
56 | | - misspell: |
57 | | - locale: US |
58 | | - lll: |
59 | | - line-length: 150 |
60 | | - nestif: |
61 | | - # minimal complexity of if statements to report, 5 by default |
62 | | - min-complexity: 7 |
63 | | - funlen: |
64 | | - lines: 360 |
65 | | - statements: 120 |
66 | | - gci: |
67 | | - sections: |
68 | | - - standard |
69 | | - - default |
70 | | -linters: |
71 | | - disable-all: true |
72 | | - enable: |
73 | | - - copyloopvar # copyloopvar is a linter detects places where loop variables are copied |
74 | | - - dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f()) |
75 | | - - errcheck # errcheck is a program for checking for unchecked errors in Go code. These unchecked errors can be critical bugs in some cases |
76 | | - - errorlint # Errorlint is a linter that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13. |
77 | | - - exhaustive # check exhaustiveness of enum switch statements |
78 | | - - copyloopvar # copyloopvar is a linter detects places where loop variables are copied. Replaces exportloopref since Go1.22 |
79 | | - - funlen # Tool for detection of long functions |
80 | | - - gci # Gci controls golang package import order and makes it always deterministic. [fast: true, auto-fix: false] |
81 | | - - gocritic # Provides diagnostics that check for bugs, performance and style issues. |
82 | | - - godot # Check if comments end in a period [fast: true, auto-fix: true] |
83 | | - - gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification |
84 | | - - goimports # Check import statements are formatted according to the 'goimport' command. Reformat imports in autofix mode. |
85 | | - - goprintffuncname # Checks that printf-like functions are named with `f` at the end. |
86 | | - - gosec # Inspects source code for security problems |
87 | | - - gosimple # Linter for Go source code that specializes in simplifying code |
88 | | - - govet # Vet examines Go source code and reports suspicious constructs. It is roughly the same as 'go vet' and uses its passes. |
89 | | - - ineffassign # Detects when assignments to existing variables are not used |
90 | | - - lll # Reports long lines |
91 | | - - makezero # Finds slice declarations with non-zero initial length |
92 | | - - misspell # Finds commonly misspelled English words |
93 | | - - nakedret # Checks that functions with naked returns are not longer than a maximum size (can be zero). |
94 | | - - noctx # Finds sending http request without context.Context |
95 | | - - nolintlint # Reports ill-formed or insufficient nolint directives |
96 | | - - perfsprint # Checks that fmt.Sprintf can be replaced with a faster alternative. |
97 | | - - prealloc # Finds slice declarations that could potentially be pre-allocated |
98 | | - - predeclared # find code that shadows one of Go's predeclared identifiers |
99 | | - - revive # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint. |
100 | | - - rowserrcheck # checks whether Rows.Err of rows is checked successfully |
101 | | - - staticcheck # It's a set of rules from staticcheck. It's not the same thing as the staticcheck binary. The author of staticcheck doesn't support or approve the use of staticcheck as a library inside golangci-lint. |
102 | | - - stylecheck # Stylecheck is a replacement for golint |
103 | | - - tenv # tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17 |
104 | | - - testifylint # Checks usage of github.com/stretchr/testify. |
105 | | - - thelper # thelper detects tests helpers which is not start with t.Helper() method. |
106 | | - - unconvert # Remove unnecessary type conversions |
107 | | - - unused # Checks Go code for unused constants, variables, functions and types |
108 | | - - whitespace # Whitespace is a linter that checks for unnecessary newlines at the start and end of functions, if, for, etc. |
109 | | - |
110 | | - # don't enable: |
111 | | - # - deadcode |
112 | | - # - varcheck |
113 | | - # - structcheck |
114 | | - # - depguard # Go linter that checks if package imports are in a list of acceptable packages [fast: true, auto-fix: false] |
115 | | - # - gocyclo # we already have funlen lint |
116 | | - # - dupl # we have a lot of duplicate test cases |
117 | | - # - gochecknoinits # we need the init function for the provider |
118 | | - # - gochecknoglobals # we need some global variables |
119 | | - # - unparam # Forces to create global variables when one variable is repeated in different functions |
120 | | - # - goerr113 # It does not allow you to return an error, you need to save the error in a variable to do it |
121 | | - # - goconst |
122 | | - # - gocognit |
123 | | - |
| 1 | +version: "2" |
124 | 2 | run: |
125 | | - timeout: 10m |
126 | | - tests: true |
127 | 3 | modules-download-mode: readonly |
| 4 | + tests: true |
| 5 | +linters: |
| 6 | + default: none |
| 7 | + enable: |
| 8 | + - copyloopvar |
| 9 | + - dogsled |
| 10 | + - errcheck |
| 11 | + - errorlint |
| 12 | + - exhaustive |
| 13 | + - funlen |
| 14 | + - gocritic |
| 15 | + - godot |
| 16 | + - goprintffuncname |
| 17 | + - gosec |
| 18 | + - govet |
| 19 | + - ineffassign |
| 20 | + - lll |
| 21 | + - makezero |
| 22 | + - misspell |
| 23 | + - nakedret |
| 24 | + - noctx |
| 25 | + - nolintlint |
| 26 | + - perfsprint |
| 27 | + - prealloc |
| 28 | + - predeclared |
| 29 | + - revive |
| 30 | + - rowserrcheck |
| 31 | + - staticcheck |
| 32 | + - testifylint |
| 33 | + - thelper |
| 34 | + - unconvert |
| 35 | + - unused |
| 36 | + - whitespace |
| 37 | + # don't enable: |
| 38 | + # - deadcode |
| 39 | + # - varcheck |
| 40 | + # - structcheck |
| 41 | + # - depguard # Go linter that checks if package imports are in a list of acceptable packages [fast: true, auto-fix: false] |
| 42 | + # - gocyclo # we already have funlen lint |
| 43 | + # - dupl # we have a lot of duplicate test cases |
| 44 | + # - gochecknoinits # we need the init function for the provider |
| 45 | + # - gochecknoglobals # we need some global variables |
| 46 | + # - unparam # Forces to create global variables when one variable is repeated in different functions |
| 47 | + # - goerr113 # It does not allow you to return an error, you need to save the error in a variable to do it |
| 48 | + # - goconst |
| 49 | + # - gocognit |
| 50 | + settings: |
| 51 | + funlen: |
| 52 | + lines: 360 |
| 53 | + statements: 120 |
| 54 | + gocritic: |
| 55 | + enabled-tags: |
| 56 | + - diagnostic |
| 57 | + - experimental |
| 58 | + - opinionated |
| 59 | + - performance |
| 60 | + - style |
| 61 | + govet: |
| 62 | + enable: |
| 63 | + - shadow |
| 64 | + lll: |
| 65 | + line-length: 150 |
| 66 | + misspell: |
| 67 | + locale: US |
| 68 | + nestif: |
| 69 | + min-complexity: 7 |
| 70 | + revive: |
| 71 | + severity: warning |
| 72 | + rules: |
| 73 | + - name: blank-imports |
| 74 | + - name: context-as-argument |
| 75 | + - name: context-keys-type |
| 76 | + - name: defer |
| 77 | + - name: dot-imports |
| 78 | + - name: error-return |
| 79 | + - name: error-strings |
| 80 | + - name: error-naming |
| 81 | + - name: early-return |
| 82 | + - name: errorf |
| 83 | + - name: exported |
| 84 | + - name: import-shadowing |
| 85 | + - name: indent-error-flow |
| 86 | + - name: if-return |
| 87 | + - name: increment-decrement |
| 88 | + - name: var-naming |
| 89 | + - name: var-declaration |
| 90 | + - name: package-comments |
| 91 | + - name: range |
| 92 | + - name: receiver-naming |
| 93 | + - name: time-naming |
| 94 | + - name: unexported-return |
| 95 | + - name: indent-error-flow |
| 96 | + - name: errorf |
| 97 | + - name: empty-block |
| 98 | + - name: superfluous-else |
| 99 | + - name: struct-tag |
| 100 | + - name: unused-parameter |
| 101 | + - name: unreachable-code |
| 102 | + - name: redefines-builtin-id |
| 103 | + - name: unused-receiver |
| 104 | + - name: constant-logical-expr |
| 105 | + - name: confusing-naming |
| 106 | + - name: unnecessary-stmt |
| 107 | + - name: use-any |
| 108 | + - name: imports-blocklist |
| 109 | + arguments: |
| 110 | + - github.com/pkg/errors |
| 111 | + exclusions: |
| 112 | + generated: lax |
| 113 | + presets: |
| 114 | + - comments |
| 115 | + - common-false-positives |
| 116 | + - legacy |
| 117 | + - std-error-handling |
| 118 | + paths: |
| 119 | + - third_party$ |
| 120 | + - builtin$ |
| 121 | + - examples$ |
| 122 | +formatters: |
| 123 | + enable: |
| 124 | + - gci |
| 125 | + - gofmt |
| 126 | + - goimports |
| 127 | + settings: |
| 128 | + gci: |
| 129 | + sections: |
| 130 | + - standard |
| 131 | + - default |
| 132 | + exclusions: |
| 133 | + generated: lax |
| 134 | + paths: |
| 135 | + - third_party$ |
| 136 | + - builtin$ |
| 137 | + - examples$ |
0 commit comments