|
1 | | -linters-settings: |
2 | | - gosec: |
3 | | - config: |
4 | | - # Maximum allowed permissions mode file creation |
5 | | - # Default: "0600" |
6 | | - G306: "0644" |
7 | | - excludes: |
8 | | - - G115 # Annoying and have a lot of false-positive results. |
9 | | - gocyclo: |
10 | | - min-complexity: 15 |
11 | | - dupl: |
12 | | - threshold: 120 |
13 | | - goconst: |
14 | | - min-len: 2 |
15 | | - min-occurrences: 3 |
16 | | - misspell: |
17 | | - locale: US |
18 | | - lll: |
19 | | - line-length: 140 |
20 | | - gocritic: |
21 | | - enabled-tags: |
22 | | - - diagnostic |
23 | | - - experimental |
24 | | - - opinionated |
25 | | - - performance |
26 | | - - style |
27 | | - disabled-checks: |
28 | | - - emptyStringTest # len(<string>) > 0 is fine and easier to read in some contexts |
29 | | - - hugeParam |
30 | | - - rangeValCopy |
31 | | - - exitAfterDefer |
32 | | - - octalLiteral |
33 | | - - httpNoBody |
34 | | - - unnecessaryBlock # for UUID encoder |
35 | | - goimports: |
36 | | - local-prefixes: github.com/ogen-go/ogen |
37 | | - |
| 1 | +version: "2" |
38 | 2 | linters: |
39 | 3 | enable: |
40 | 4 | - dogsled |
41 | | - - errcheck |
42 | 5 | - goconst |
43 | 6 | - gocritic |
44 | | - - revive |
45 | 7 | - gosec |
46 | | - - govet |
47 | | - - ineffassign |
48 | 8 | - lll |
49 | 9 | - misspell |
50 | 10 | - nakedret |
51 | | - - typecheck |
| 11 | + - revive |
52 | 12 | - unconvert |
53 | 13 | - unparam |
54 | 14 | - whitespace |
55 | | - - unused |
| 15 | + settings: |
| 16 | + dupl: |
| 17 | + threshold: 120 |
| 18 | + goconst: |
| 19 | + min-len: 2 |
| 20 | + min-occurrences: 3 |
| 21 | + gocritic: |
| 22 | + disabled-checks: |
| 23 | + - emptyStringTest |
| 24 | + - hugeParam |
| 25 | + - rangeValCopy |
| 26 | + - exitAfterDefer |
| 27 | + - octalLiteral |
| 28 | + - httpNoBody |
| 29 | + - unnecessaryBlock |
| 30 | + enabled-tags: |
| 31 | + - diagnostic |
| 32 | + - experimental |
| 33 | + - opinionated |
| 34 | + - performance |
| 35 | + - style |
| 36 | + gocyclo: |
| 37 | + min-complexity: 15 |
| 38 | + gosec: |
| 39 | + excludes: |
| 40 | + - G115 |
| 41 | + config: |
| 42 | + G306: "0644" |
| 43 | + lll: |
| 44 | + line-length: 140 |
| 45 | + misspell: |
| 46 | + locale: US |
| 47 | + exclusions: |
| 48 | + generated: lax |
| 49 | + rules: |
| 50 | + - linters: |
| 51 | + - lll |
| 52 | + source: //go:generate |
| 53 | + - linters: |
| 54 | + - lll |
| 55 | + source: // See https:// |
| 56 | + - linters: |
| 57 | + - dupl |
| 58 | + - errcheck |
| 59 | + - funlen |
| 60 | + - gocognit |
| 61 | + - goconst |
| 62 | + - gocyclo |
| 63 | + - gosec |
| 64 | + - lll |
| 65 | + - scopelint |
| 66 | + path: _test\.go |
| 67 | + - linters: |
| 68 | + - unparam |
| 69 | + path: _test\.go |
| 70 | + text: .*\$\d? |
| 71 | + - linters: |
| 72 | + - govet |
| 73 | + text: declaration of "(err|ctx|log)" |
| 74 | + - linters: |
| 75 | + - funlen |
| 76 | + - gocognit |
| 77 | + - goconst |
| 78 | + - gocyclo |
| 79 | + path: (cmd|tools) |
| 80 | + - linters: |
| 81 | + - golint |
| 82 | + - revive |
| 83 | + path: (conv|uri|gen|otelogen) |
| 84 | + text: (should have comment.+or be unexported|comment on exported) |
| 85 | + - linters: |
| 86 | + - golint |
| 87 | + - revive |
| 88 | + path: (cmd|tools|internal) |
| 89 | + text: should have (comment.+or be unexported|a package comment) |
| 90 | + - linters: |
| 91 | + - golint |
| 92 | + - revive |
| 93 | + text: (unused-parameter|if-return) |
| 94 | + - linters: |
| 95 | + - gocritic |
| 96 | + text: ptrToRefParam |
| 97 | + source: handleSchemaDepth |
| 98 | + - path: (cmd|tools) |
| 99 | + text: G(304|306|307) |
| 100 | + - path: techempower |
| 101 | + text: G114 |
| 102 | + - linters: |
| 103 | + - gocritic |
| 104 | + path: (http|uri) |
| 105 | + text: sprintfQuotedString |
| 106 | + source: form-data; name="%s" |
| 107 | + - linters: |
| 108 | + - gocritic |
| 109 | + path: ogenregex[/\\]convert\.go |
| 110 | + text: emptyFallthrough |
| 111 | + - linters: |
| 112 | + - goconst |
| 113 | + text: string `(string|number|u?int\d{0,2}|float\d{2})` |
| 114 | + - linters: |
| 115 | + - goconst |
| 116 | + text: string `(Unix|unix|date|time|ipv6|String|DateTime|Number) |
| 117 | + paths: |
| 118 | + - third_party$ |
| 119 | + - builtin$ |
| 120 | + - examples$ |
| 121 | +formatters: |
| 122 | + enable: |
56 | 123 | - goimports |
57 | | - # Do not enable: |
58 | | - # - wsl (too opinionated about newlines) |
59 | | - # - godox (todos are OK) |
60 | | - # - bodyclose (false positives on helper functions) |
61 | | - # - prealloc (not worth it in scope of this project) |
62 | | - # - maligned (same as prealloc) |
63 | | - # - funlen (gocyclo is enough) |
64 | | - # - gochecknoglobals (we know when it is ok to use globals) |
65 | | - # - gochecknoinits (we know when it is ok to use inits) |
66 | | - # - dupl (validator/parser package are false positive) |
67 | | - |
68 | | -issues: |
69 | | - exclude-use-default: false |
70 | | - exclude-rules: |
71 | | - # Exclude go:generate from lll |
72 | | - - source: "//go:generate" |
73 | | - linters: [lll] |
74 | | - |
75 | | - # Exclude links from lll |
76 | | - - source: "// See https://" |
77 | | - linters: [lll] |
78 | | - |
79 | | - # Disable linters that are annoying in tests. |
80 | | - - path: _test\.go |
81 | | - linters: |
82 | | - - gocyclo |
83 | | - - errcheck |
84 | | - - dupl |
85 | | - - gosec |
86 | | - - funlen |
87 | | - - goconst |
88 | | - - gocognit |
89 | | - - scopelint |
90 | | - - lll |
91 | | - # Do not warn about unused closure parameters in test files. |
92 | | - - path: _test\.go |
93 | | - linters: [unparam] |
94 | | - text: .*\$\d? |
95 | | - |
96 | | - # Ignore shadowing of err. |
97 | | - - linters: [govet] |
98 | | - text: 'declaration of "(err|ctx|log)"' |
99 | | - |
100 | | - # Ignore linters in main packages. |
101 | | - - path: (cmd|tools) |
102 | | - linters: [goconst, funlen, gocognit, gocyclo] |
103 | | - |
104 | | - # TODO(tdakkota): add comments? |
105 | | - - path: (conv|uri|gen|otelogen) |
106 | | - linters: [revive, golint] |
107 | | - text: "(should have comment.+or be unexported|comment on exported)" |
108 | | - |
109 | | - # We don't need package comments for internal packages. |
110 | | - # We don't need comments for command packages. |
111 | | - - path: (cmd|tools|internal) |
112 | | - linters: [revive, golint] |
113 | | - text: "should have (comment.+or be unexported|a package comment)" |
114 | | - |
115 | | - # Annoying and useless. |
116 | | - - linters: [revive, golint] |
117 | | - text: "(unused-parameter|if-return)" |
118 | | - |
119 | | - - linters: [gocritic] |
120 | | - text: ptrToRefParam |
121 | | - source: handleSchemaDepth |
122 | | - |
123 | | - # Intended in commands: |
124 | | - # G307: Deferring unsafe method "Close" on type "*os.File" |
125 | | - # G304: Potential file inclusion via variable |
126 | | - - path: (cmd|tools) |
127 | | - text: G(304|306|307) |
128 | | - |
129 | | - # Nobody cares. |
130 | | - # G114: Use of net/http serve function that has no support for setting timeouts |
131 | | - - path: techempower |
132 | | - text: G114 |
133 | | - |
134 | | - # We are using quoting algorithm from mime/multipart package. False-positive. |
135 | | - - path: (http|uri) |
136 | | - source: form-data; name="%s" |
137 | | - linters: [gocritic] |
138 | | - text: sprintfQuotedString |
139 | | - |
140 | | - # Keep empty fallthrough for better readability. |
141 | | - - path: ogenregex[/\\]convert\.go |
142 | | - linters: [gocritic] |
143 | | - text: emptyFallthrough |
144 | | - |
145 | | - # Not supposed to be constant. |
146 | | - - linters: [goconst] |
147 | | - text: 'string `(string|number|u?int\d{0,2}|float\d{2})`' |
148 | | - - linters: [goconst] |
149 | | - text: "string `(Unix|unix|date|time|ipv6)" |
| 124 | + settings: |
| 125 | + goimports: |
| 126 | + local-prefixes: |
| 127 | + - github.com/ogen-go/ogen |
| 128 | + exclusions: |
| 129 | + generated: lax |
| 130 | + paths: |
| 131 | + - third_party$ |
| 132 | + - builtin$ |
| 133 | + - examples$ |
0 commit comments