|
| 1 | +version: "2" |
| 2 | +output: |
| 3 | + sort-order: |
| 4 | + - file |
1 | 5 | linters: |
2 | | - enable-all: false |
3 | | - disable-all: true |
4 | | - fast: false |
| 6 | + default: none |
5 | 7 | enable: |
6 | 8 | - bidichk |
7 | 9 | - depguard |
8 | 10 | - dupl |
9 | 11 | - errcheck |
10 | 12 | - forbidigo |
11 | 13 | - gocritic |
12 | | - - gofmt |
13 | | - - gofumpt |
14 | | - - gosimple |
15 | 14 | - govet |
16 | 15 | - ineffassign |
17 | 16 | - nakedret |
18 | 17 | - nolintlint |
19 | 18 | - revive |
20 | 19 | - staticcheck |
21 | | - - stylecheck |
22 | 20 | - testifylint |
23 | | - - typecheck |
24 | 21 | - unconvert |
25 | | - - unused |
26 | 22 | - unparam |
| 23 | + - unused |
27 | 24 | - usetesting |
28 | 25 | - wastedassign |
29 | | - |
30 | | -run: |
31 | | - timeout: 10m |
32 | | - |
33 | | -output: |
34 | | - sort-results: true |
35 | | - sort-order: [file] |
36 | | - show-stats: true |
37 | | - |
38 | | -linters-settings: |
39 | | - testifylint: |
40 | | - disable: |
41 | | - - go-require |
42 | | - - require-error |
43 | | - stylecheck: |
44 | | - checks: ["all", "-ST1005", "-ST1003"] |
45 | | - nakedret: |
46 | | - max-func-lines: 0 |
47 | | - gocritic: |
48 | | - disabled-checks: |
49 | | - - ifElseChain |
50 | | - - singleCaseSwitch # Every time this occurred in the code, there was no other way. |
51 | | - revive: |
52 | | - severity: error |
53 | | - rules: |
54 | | - - name: atomic |
55 | | - - name: bare-return |
56 | | - - name: blank-imports |
57 | | - - name: constant-logical-expr |
58 | | - - name: context-as-argument |
59 | | - - name: context-keys-type |
60 | | - - name: dot-imports |
61 | | - - name: duplicated-imports |
62 | | - - name: empty-lines |
63 | | - - name: error-naming |
64 | | - - name: error-return |
65 | | - - name: error-strings |
66 | | - - name: errorf |
67 | | - - name: exported |
68 | | - - name: identical-branches |
69 | | - - name: if-return |
70 | | - - name: increment-decrement |
71 | | - - name: indent-error-flow |
72 | | - - name: modifies-value-receiver |
73 | | - - name: package-comments |
74 | | - - name: range |
75 | | - - name: receiver-naming |
76 | | - - name: redefines-builtin-id |
77 | | - - name: string-of-int |
78 | | - - name: superfluous-else |
79 | | - - name: time-naming |
80 | | - - name: unconditional-recursion |
81 | | - - name: unexported-return |
82 | | - - name: unreachable-code |
83 | | - - name: var-declaration |
84 | | - - name: var-naming |
85 | | - gofumpt: |
86 | | - extra-rules: true |
87 | | - depguard: |
| 26 | + settings: |
| 27 | + depguard: |
| 28 | + rules: |
| 29 | + main: |
| 30 | + deny: |
| 31 | + - pkg: encoding/json |
| 32 | + desc: use gitea's modules/json instead of encoding/json |
| 33 | + - pkg: github.com/unknwon/com |
| 34 | + desc: use gitea's util and replacements |
| 35 | + - pkg: io/ioutil |
| 36 | + desc: use os or io instead |
| 37 | + - pkg: golang.org/x/exp |
| 38 | + desc: it's experimental and unreliable |
| 39 | + - pkg: code.gitea.io/gitea/modules/git/internal |
| 40 | + desc: do not use the internal package, use AddXxx function instead |
| 41 | + - pkg: gopkg.in/ini.v1 |
| 42 | + desc: do not use the ini package, use gitea's config system instead |
| 43 | + - pkg: gitea.com/go-chi/cache |
| 44 | + desc: do not use the go-chi cache package, use gitea's cache system |
| 45 | + gocritic: |
| 46 | + disabled-checks: |
| 47 | + - ifElseChain |
| 48 | + - singleCaseSwitch # Every time this occurred in the code, there was no other way. |
| 49 | + revive: |
| 50 | + severity: error |
| 51 | + rules: |
| 52 | + - name: atomic |
| 53 | + - name: bare-return |
| 54 | + - name: blank-imports |
| 55 | + - name: constant-logical-expr |
| 56 | + - name: context-as-argument |
| 57 | + - name: context-keys-type |
| 58 | + - name: dot-imports |
| 59 | + - name: duplicated-imports |
| 60 | + - name: empty-lines |
| 61 | + - name: error-naming |
| 62 | + - name: error-return |
| 63 | + - name: error-strings |
| 64 | + - name: errorf |
| 65 | + - name: exported |
| 66 | + - name: identical-branches |
| 67 | + - name: if-return |
| 68 | + - name: increment-decrement |
| 69 | + - name: indent-error-flow |
| 70 | + - name: modifies-value-receiver |
| 71 | + - name: package-comments |
| 72 | + - name: range |
| 73 | + - name: receiver-naming |
| 74 | + - name: redefines-builtin-id |
| 75 | + - name: string-of-int |
| 76 | + - name: superfluous-else |
| 77 | + - name: time-naming |
| 78 | + - name: unconditional-recursion |
| 79 | + - name: unexported-return |
| 80 | + - name: unreachable-code |
| 81 | + - name: var-declaration |
| 82 | + - name: var-naming |
| 83 | + staticcheck: |
| 84 | + checks: |
| 85 | + - all |
| 86 | + - -ST1003 |
| 87 | + - -ST1005 |
| 88 | + - -QF1001 |
| 89 | + - -QF1002 |
| 90 | + - -QF1003 |
| 91 | + - -QF1006 |
| 92 | + - -QF1007 |
| 93 | + - -QF1008 |
| 94 | + - -QF1009 |
| 95 | + - -QF1012 |
| 96 | + testifylint: |
| 97 | + disable: |
| 98 | + - go-require |
| 99 | + - require-error |
| 100 | + - equal-values |
| 101 | + - empty |
| 102 | + - formatter |
| 103 | + - len |
| 104 | + usetesting: |
| 105 | + os-temp-dir: true |
| 106 | + exclusions: |
| 107 | + generated: lax |
| 108 | + presets: |
| 109 | + - comments |
| 110 | + - common-false-positives |
| 111 | + - legacy |
| 112 | + - std-error-handling |
88 | 113 | rules: |
89 | | - main: |
90 | | - deny: |
91 | | - - pkg: encoding/json |
92 | | - desc: use gitea's modules/json instead of encoding/json |
93 | | - - pkg: github.com/unknwon/com |
94 | | - desc: use gitea's util and replacements |
95 | | - - pkg: io/ioutil |
96 | | - desc: use os or io instead |
97 | | - - pkg: golang.org/x/exp |
98 | | - desc: it's experimental and unreliable |
99 | | - - pkg: code.gitea.io/gitea/modules/git/internal |
100 | | - desc: do not use the internal package, use AddXxx function instead |
101 | | - - pkg: gopkg.in/ini.v1 |
102 | | - desc: do not use the ini package, use gitea's config system instead |
103 | | - - pkg: gitea.com/go-chi/cache |
104 | | - desc: do not use the go-chi cache package, use gitea's cache system |
105 | | - usetesting: |
106 | | - os-temp-dir: true |
107 | | - |
| 114 | + - linters: |
| 115 | + - dupl |
| 116 | + - errcheck |
| 117 | + - gocyclo |
| 118 | + - gosec |
| 119 | + - staticcheck |
| 120 | + - unparam |
| 121 | + path: _test\.go |
| 122 | + - linters: |
| 123 | + - dupl |
| 124 | + - errcheck |
| 125 | + - gocyclo |
| 126 | + - gosec |
| 127 | + path: models/migrations/v |
| 128 | + - linters: |
| 129 | + - forbidigo |
| 130 | + path: cmd |
| 131 | + - linters: |
| 132 | + - dupl |
| 133 | + text: (?i)webhook |
| 134 | + - linters: |
| 135 | + - gocritic |
| 136 | + text: (?i)`ID' should not be capitalized |
| 137 | + - linters: |
| 138 | + - deadcode |
| 139 | + - unused |
| 140 | + text: (?i)swagger |
| 141 | + - linters: |
| 142 | + - staticcheck |
| 143 | + text: (?i)argument x is overwritten before first use |
| 144 | + - linters: |
| 145 | + - gocritic |
| 146 | + text: '(?i)commentFormatting: put a space between `//` and comment text' |
| 147 | + - linters: |
| 148 | + - gocritic |
| 149 | + text: '(?i)exitAfterDefer:' |
| 150 | + paths: |
| 151 | + - node_modules |
| 152 | + - public |
| 153 | + - web_src |
| 154 | + - third_party$ |
| 155 | + - builtin$ |
| 156 | + - examples$ |
108 | 157 | issues: |
109 | 158 | max-issues-per-linter: 0 |
110 | 159 | max-same-issues: 0 |
111 | | - exclude-dirs: [node_modules, public, web_src] |
112 | | - exclude-case-sensitive: true |
113 | | - exclude-rules: |
114 | | - - path: _test\.go |
115 | | - linters: |
116 | | - - gocyclo |
117 | | - - errcheck |
118 | | - - dupl |
119 | | - - gosec |
120 | | - - unparam |
121 | | - - staticcheck |
122 | | - - path: models/migrations/v |
123 | | - linters: |
124 | | - - gocyclo |
125 | | - - errcheck |
126 | | - - dupl |
127 | | - - gosec |
128 | | - - path: cmd |
129 | | - linters: |
130 | | - - forbidigo |
131 | | - - text: "webhook" |
132 | | - linters: |
133 | | - - dupl |
134 | | - - text: "`ID' should not be capitalized" |
135 | | - linters: |
136 | | - - gocritic |
137 | | - - text: "swagger" |
138 | | - linters: |
139 | | - - unused |
140 | | - - deadcode |
141 | | - - text: "argument x is overwritten before first use" |
142 | | - linters: |
143 | | - - staticcheck |
144 | | - - text: "commentFormatting: put a space between `//` and comment text" |
145 | | - linters: |
146 | | - - gocritic |
147 | | - - text: "exitAfterDefer:" |
148 | | - linters: |
149 | | - - gocritic |
| 160 | +formatters: |
| 161 | + enable: |
| 162 | + - gofmt |
| 163 | + - gofumpt |
| 164 | + settings: |
| 165 | + gofumpt: |
| 166 | + extra-rules: true |
| 167 | + exclusions: |
| 168 | + generated: lax |
| 169 | + paths: |
| 170 | + - node_modules |
| 171 | + - public |
| 172 | + - web_src |
| 173 | + - third_party$ |
| 174 | + - builtin$ |
| 175 | + - examples$ |
| 176 | + |
| 177 | +run: |
| 178 | + timeout: 10m |
0 commit comments