|
14 | 14 | version: "2" |
15 | 15 |
|
16 | 16 | linters: |
17 | | - disable-all: true |
| 17 | + default: none |
18 | 18 | # This list of linters is not a recommendation (same thing for all this configuration file). |
19 | 19 | # We intentionally use a limited set of linters. |
20 | 20 | # See the comment on top of this file. |
@@ -53,6 +53,92 @@ linters: |
53 | 53 | - unparam |
54 | 54 | - unused |
55 | 55 | - whitespace |
| 56 | + |
| 57 | + settings: |
| 58 | + depguard: |
| 59 | + rules: |
| 60 | + logger: |
| 61 | + deny: |
| 62 | + # logging is allowed only by logutils.Log, |
| 63 | + - pkg: "github.com/sirupsen/logrus" |
| 64 | + desc: logging is allowed only by logutils.Log. |
| 65 | + - pkg: "github.com/pkg/errors" |
| 66 | + desc: Should be replaced by standard lib errors package. |
| 67 | + - pkg: "github.com/instana/testify" |
| 68 | + desc: It's a fork of github.com/stretchr/testify. |
| 69 | + files: |
| 70 | + # logrus is allowed to use only in logutils package. |
| 71 | + - "!**/pkg/logutils/**.go" |
| 72 | + dupl: |
| 73 | + threshold: 100 |
| 74 | + funlen: |
| 75 | + lines: -1 # the number of lines (code + empty lines) is not a right metric and leads to code without empty line or one-liner. |
| 76 | + statements: 50 |
| 77 | + goconst: |
| 78 | + min-len: 2 |
| 79 | + min-occurrences: 3 |
| 80 | + gocritic: |
| 81 | + enabled-tags: |
| 82 | + - diagnostic |
| 83 | + - experimental |
| 84 | + - opinionated |
| 85 | + - performance |
| 86 | + - style |
| 87 | + disabled-checks: |
| 88 | + - dupImport # https://github.com/go-critic/go-critic/issues/845 |
| 89 | + - ifElseChain |
| 90 | + - octalLiteral |
| 91 | + - whyNoLint |
| 92 | + gocyclo: |
| 93 | + min-complexity: 15 |
| 94 | + godox: |
| 95 | + keywords: |
| 96 | + - FIXME |
| 97 | + mnd: |
| 98 | + # don't include the "operation" and "assign" |
| 99 | + checks: |
| 100 | + - argument |
| 101 | + - case |
| 102 | + - condition |
| 103 | + - return |
| 104 | + ignored-numbers: |
| 105 | + - '0' |
| 106 | + - '1' |
| 107 | + - '2' |
| 108 | + - '3' |
| 109 | + ignored-functions: |
| 110 | + - strings.SplitN |
| 111 | + govet: |
| 112 | + settings: |
| 113 | + printf: |
| 114 | + funcs: |
| 115 | + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof |
| 116 | + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf |
| 117 | + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf |
| 118 | + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf |
| 119 | + enable: |
| 120 | + - nilness |
| 121 | + - shadow |
| 122 | + errorlint: |
| 123 | + asserts: false |
| 124 | + lll: |
| 125 | + line-length: 140 |
| 126 | + misspell: |
| 127 | + locale: US |
| 128 | + ignore-rules: |
| 129 | + - "importas" # linter name |
| 130 | + nolintlint: |
| 131 | + allow-unused: false # report any unused nolint directives |
| 132 | + require-explanation: true # require an explanation for nolint directives |
| 133 | + require-specific: true # require nolint directives to be specific about which linter is being skipped |
| 134 | + revive: |
| 135 | + rules: |
| 136 | + - name: indent-error-flow |
| 137 | + - name: unexported-return |
| 138 | + disabled: true |
| 139 | + - name: unused-parameter |
| 140 | + - name: unused-receiver |
| 141 | + |
56 | 142 | exclusions: |
57 | 143 | presets: |
58 | 144 | - comments |
@@ -95,88 +181,3 @@ formatters: |
95 | 181 | local-prefixes: |
96 | 182 | - github.com/golangci/golangci-lint |
97 | 183 |
|
98 | | -linters-settings: |
99 | | - depguard: |
100 | | - rules: |
101 | | - logger: |
102 | | - deny: |
103 | | - # logging is allowed only by logutils.Log, |
104 | | - - pkg: "github.com/sirupsen/logrus" |
105 | | - desc: logging is allowed only by logutils.Log. |
106 | | - - pkg: "github.com/pkg/errors" |
107 | | - desc: Should be replaced by standard lib errors package. |
108 | | - - pkg: "github.com/instana/testify" |
109 | | - desc: It's a fork of github.com/stretchr/testify. |
110 | | - files: |
111 | | - # logrus is allowed to use only in logutils package. |
112 | | - - "!**/pkg/logutils/**.go" |
113 | | - dupl: |
114 | | - threshold: 100 |
115 | | - funlen: |
116 | | - lines: -1 # the number of lines (code + empty lines) is not a right metric and leads to code without empty line or one-liner. |
117 | | - statements: 50 |
118 | | - goconst: |
119 | | - min-len: 2 |
120 | | - min-occurrences: 3 |
121 | | - gocritic: |
122 | | - enabled-tags: |
123 | | - - diagnostic |
124 | | - - experimental |
125 | | - - opinionated |
126 | | - - performance |
127 | | - - style |
128 | | - disabled-checks: |
129 | | - - dupImport # https://github.com/go-critic/go-critic/issues/845 |
130 | | - - ifElseChain |
131 | | - - octalLiteral |
132 | | - - whyNoLint |
133 | | - gocyclo: |
134 | | - min-complexity: 15 |
135 | | - godox: |
136 | | - keywords: |
137 | | - - FIXME |
138 | | - mnd: |
139 | | - # don't include the "operation" and "assign" |
140 | | - checks: |
141 | | - - argument |
142 | | - - case |
143 | | - - condition |
144 | | - - return |
145 | | - ignored-numbers: |
146 | | - - '0' |
147 | | - - '1' |
148 | | - - '2' |
149 | | - - '3' |
150 | | - ignored-functions: |
151 | | - - strings.SplitN |
152 | | - govet: |
153 | | - settings: |
154 | | - printf: |
155 | | - funcs: |
156 | | - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof |
157 | | - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf |
158 | | - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf |
159 | | - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf |
160 | | - enable: |
161 | | - - nilness |
162 | | - - shadow |
163 | | - errorlint: |
164 | | - asserts: false |
165 | | - lll: |
166 | | - line-length: 140 |
167 | | - misspell: |
168 | | - locale: US |
169 | | - ignore-rules: |
170 | | - - "importas" # linter name |
171 | | - nolintlint: |
172 | | - allow-unused: false # report any unused nolint directives |
173 | | - require-explanation: true # require an explanation for nolint directives |
174 | | - require-specific: true # require nolint directives to be specific about which linter is being skipped |
175 | | - revive: |
176 | | - rules: |
177 | | - - name: indent-error-flow |
178 | | - - name: unexported-return |
179 | | - disabled: true |
180 | | - - name: unused-parameter |
181 | | - - name: unused-receiver |
182 | | - |
|
0 commit comments