|
1 | | -# https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml |
2 | | - |
3 | | -linters-settings: |
4 | | - gci: |
5 | | - sections: |
6 | | - - standard |
7 | | - - default |
8 | | - - prefix(github.com/crowdsecurity) |
9 | | - - prefix(github.com/crowdsecurity/crowdsec) |
10 | | - - prefix(github.com/crowdsecurity/cs-custom-bouncer) |
11 | | - |
12 | | - govet: |
13 | | - enable-all: true |
14 | | - disable: |
15 | | - - fieldalignment |
16 | | - |
17 | | - misspell: |
18 | | - locale: US |
19 | | - |
20 | | - nlreturn: |
21 | | - block-size: 4 |
22 | | - |
23 | | - nolintlint: |
24 | | - allow-unused: false # report any unused nolint directives |
25 | | - require-explanation: false # don't require an explanation for nolint directives |
26 | | - require-specific: false # don't require nolint directives to be specific about which linter is being skipped |
27 | | - |
28 | | - depguard: |
29 | | - rules: |
30 | | - main: |
31 | | - deny: |
32 | | - - pkg: "github.com/pkg/errors" |
33 | | - desc: "errors.Wrap() is deprecated in favor of fmt.Errorf()" |
34 | | - |
35 | | - stylecheck: |
36 | | - checks: |
37 | | - - all |
38 | | - - -ST1003 # should not use underscores in Go names; ... |
39 | | - - -ST1005 # error strings should not be capitalized |
40 | | - - -ST1012 # error var ... should have name of the form ErrFoo |
41 | | - - -ST1016 # methods on the same type should have the same receiver name |
42 | | - - -ST1022 # comment on exported var ... should be of the form ... |
43 | | - |
44 | | - revive: |
45 | | - ignore-generated-header: true |
46 | | - severity: error |
47 | | - enable-all-rules: true |
48 | | - rules: |
49 | | - - name: add-constant |
50 | | - disabled: true |
51 | | - - name: cognitive-complexity |
52 | | - disabled: true |
53 | | - - name: comment-spacings |
54 | | - disabled: true |
55 | | - - name: confusing-results |
56 | | - disabled: true |
57 | | - - name: cyclomatic |
58 | | - disabled: true |
59 | | - - name: empty-lines |
60 | | - disabled: true |
61 | | - - name: flag-parameter |
62 | | - disabled: true |
63 | | - - name: function-length |
64 | | - disabled: true |
65 | | - - name: if-return |
66 | | - disabled: true |
67 | | - - name: import-alias-naming |
68 | | - disabled: true |
69 | | - - name: import-shadowing |
70 | | - disabled: true |
71 | | - - name: line-length-limit |
72 | | - disabled: true |
73 | | - - name: nested-structs |
74 | | - disabled: true |
75 | | - - name: var-declaration |
76 | | - disabled: true |
77 | | - - name: exported |
78 | | - disabled: true |
79 | | - - name: unexported-naming |
80 | | - disabled: true |
81 | | - - name: unexported-return |
82 | | - disabled: true |
83 | | - - name: unhandled-error |
84 | | - disabled: true |
85 | | - arguments: |
86 | | - - "fmt.Print" |
87 | | - - "fmt.Printf" |
88 | | - - "fmt.Println" |
89 | | - - name: unused-receiver |
90 | | - disabled: true |
91 | | - - name: function-result-limit |
92 | | - arguments: |
93 | | - - 5 |
94 | | - wsl: |
95 | | - # Allow blocks to end with comments |
96 | | - allow-trailing-comment: true |
| 1 | +version: "2" |
97 | 2 |
|
98 | 3 | linters: |
99 | | - enable-all: true |
| 4 | + default: all |
100 | 5 | disable: |
101 | | - # |
102 | | - # DEPRECATED by golangi-lint |
103 | | - # |
104 | | - |
105 | | - # |
106 | | - # Redundant |
107 | | - # |
108 | | - |
| 6 | + - contextcheck |
109 | 7 | - cyclop |
110 | | - - tenv |
111 | | - - lll |
| 8 | + - dupl |
| 9 | + - err113 |
| 10 | + - exhaustruct |
| 11 | + - forbidigo |
112 | 12 | - funlen |
| 13 | + - gochecknoglobals |
113 | 14 | - gocognit |
114 | | - |
115 | | - # |
116 | | - # Recommended? (easy) |
117 | | - # |
118 | | - |
119 | | - - gosec # (gas): Inspects source code for security problems |
120 | | - - revive # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint. |
121 | | - - wrapcheck # Checks that errors returned from external packages are wrapped |
122 | | - |
123 | | - # |
124 | | - # Recommended? (requires some work) |
125 | | - # |
126 | | - |
127 | | - - contextcheck # check the function whether use a non-inherited context |
128 | | - - mnd # An analyzer to detect magic numbers. |
129 | | - - unparam # Reports unused function parameters |
130 | | - |
131 | | - # |
132 | | - # Formatting only, useful in IDE but should not be forced on CI? |
133 | | - # |
134 | | - |
135 | | - - gofumpt # Gofumpt checks whether code was gofumpt-ed. |
136 | | - - nlreturn # nlreturn checks for a new line before return and branch statements to increase code clarity |
137 | | - - whitespace # Whitespace is a linter that checks for unnecessary newlines at the start and end of functions, if, for, etc. |
138 | | - - wsl # add or remove empty lines |
139 | | - |
140 | | - # |
141 | | - # Well intended, but not ready for this |
142 | | - # |
143 | | - - dupl # Tool for code clone detection |
144 | | - - err113 # Golang linter to check the errors handling expressions |
145 | | - - paralleltest # paralleltest detects missing usage of t.Parallel() method in your Go test |
146 | | - - testpackage # linter that makes you use a separate _test package |
147 | | - |
148 | | - # |
149 | | - # Too strict / too many false positives (for now?) |
150 | | - # |
151 | | - - exhaustruct # Checks if all structure fields are initialized |
152 | | - - forbidigo # Forbids identifiers |
153 | | - - gochecknoglobals # check that no global variables exist |
154 | | - - goconst # Finds repeated strings that could be replaced by a constant |
155 | | - - tagliatelle # Checks the struct tags. |
156 | | - - varnamelen # checks that the length of a variable's name matches its scope |
157 | | - |
| 15 | + - goconst |
| 16 | + - gosec |
| 17 | + - lll |
| 18 | + - mnd |
| 19 | + - nlreturn |
| 20 | + - paralleltest |
| 21 | + - tagliatelle |
| 22 | + - testpackage |
| 23 | + - varnamelen |
| 24 | + - whitespace |
| 25 | + - wrapcheck |
| 26 | + - wsl |
| 27 | + settings: |
| 28 | + |
| 29 | + depguard: |
| 30 | + rules: |
| 31 | + main: |
| 32 | + deny: |
| 33 | + - pkg: github.com/pkg/errors |
| 34 | + desc: errors.Wrap() is deprecated in favor of fmt.Errorf() |
| 35 | + govet: |
| 36 | + disable: |
| 37 | + - fieldalignment |
| 38 | + |
| 39 | + enable-all: true |
| 40 | + |
| 41 | + misspell: |
| 42 | + locale: US |
| 43 | + |
| 44 | + nlreturn: |
| 45 | + block-size: 4 |
| 46 | + |
| 47 | + nolintlint: |
| 48 | + require-explanation: false |
| 49 | + require-specific: false |
| 50 | + allow-unused: false |
| 51 | + |
| 52 | + revive: |
| 53 | + severity: error |
| 54 | + enable-all-rules: true |
| 55 | + rules: |
| 56 | + - name: add-constant |
| 57 | + disabled: true |
| 58 | + - name: cognitive-complexity |
| 59 | + disabled: true |
| 60 | + - name: comment-spacings |
| 61 | + disabled: true |
| 62 | + - name: confusing-results |
| 63 | + disabled: true |
| 64 | + - name: cyclomatic |
| 65 | + disabled: true |
| 66 | + - name: empty-lines |
| 67 | + disabled: true |
| 68 | + - name: flag-parameter |
| 69 | + disabled: true |
| 70 | + - name: function-length |
| 71 | + disabled: true |
| 72 | + - name: import-shadowing |
| 73 | + disabled: true |
| 74 | + - name: line-length-limit |
| 75 | + disabled: true |
| 76 | + - name: nested-structs |
| 77 | + disabled: true |
| 78 | + - name: var-declaration |
| 79 | + disabled: true |
| 80 | + - name: exported |
| 81 | + disabled: true |
| 82 | + - name: unexported-naming |
| 83 | + disabled: true |
| 84 | + - name: unexported-return |
| 85 | + disabled: true |
| 86 | + - name: unhandled-error |
| 87 | + arguments: |
| 88 | + - fmt.Print |
| 89 | + - fmt.Printf |
| 90 | + - fmt.Println |
| 91 | + disabled: true |
| 92 | + - name: function-result-limit |
| 93 | + arguments: |
| 94 | + - 5 |
| 95 | + staticcheck: |
| 96 | + checks: |
| 97 | + - all |
| 98 | + wsl: |
| 99 | + allow-trailing-comment: true |
| 100 | + exclusions: |
| 101 | + presets: |
| 102 | + - comments |
| 103 | + - common-false-positives |
| 104 | + - legacy |
| 105 | + - std-error-handling |
| 106 | + rules: |
| 107 | + - linters: |
| 108 | + - govet |
| 109 | + text: 'shadow: declaration of "err" shadows declaration' |
| 110 | + paths: |
| 111 | + - third_party$ |
| 112 | + - builtin$ |
| 113 | + - examples$ |
158 | 114 | issues: |
159 | | - exclude-generated: strict |
160 | | - |
161 | 115 | max-issues-per-linter: 0 |
162 | 116 | max-same-issues: 10 |
163 | | - exclude-rules: |
164 | | - # `err` is often shadowed, we may continue to do it |
165 | | - - linters: |
166 | | - - govet |
167 | | - text: "shadow: declaration of \"err\" shadows declaration" |
| 117 | +formatters: |
| 118 | + enable: |
| 119 | + - gci |
| 120 | + - gofmt |
| 121 | + - goimports |
| 122 | + settings: |
| 123 | + gci: |
| 124 | + sections: |
| 125 | + - standard |
| 126 | + - default |
| 127 | + - prefix(github.com/crowdsecurity) |
| 128 | + - prefix(github.com/crowdsecurity/crowdsec) |
| 129 | + - prefix(github.com/crowdsecurity/cs-custom-bouncer) |
| 130 | + exclusions: |
| 131 | + paths: |
| 132 | + - third_party$ |
| 133 | + - builtin$ |
| 134 | + - examples$ |
0 commit comments