Commit 31208a5
committed
lint: enable revive with an explicit rule list, drop maintidx
Second half of #1991. These are the two you and Angelo were asked about and I have gone
ahead and made the call on both, happy to change either.
revive: enabled, but not with enable-all-rules. That reports 3452 issues over 688 files,
which is not something anyone can review in one go. The config now lists 38 rules
explicitly, all of which are already clean tree-wide, so revive lands as a ratchet against
new code rather than as a backlog. Four fixes were needed to get there: one comment
spacing in a zkatdlog test and three in txgen's error.go.
The rules left out are named in a comment in the config with their current counts, so the
next step does not have to re-measure. The big ones are exported (1568), unused-parameter
(362), unused-receiver (334) and import-shadowing (328). Three more are left out because
another enabled linter already covers them, line-length-limit by lll, imports-blocklist by
depguard, file-header by goheader, and six because they are no-ops at their default
settings.
Dropping enable-all-rules also removes the nine "disabled: true" entries, which only
existed to switch rules back off, and argument-limit and function-result-limit, which
were tuned but have 103 and 49 violations and so belong with the deferred set.
maintidx: settings block deleted rather than enabled. It reports 19 functions and every
one of them would have to be suppressed: 12 are in _test.go, 4 are in the shared testutils
and dbtest helpers, 1 is Prove in the CSP range proof, and 2 are the fungible suite entry
point and its topology. The score is driven by Halstead volume, so a long table-driven
test or a flat block of declarative topology wiring scores badly for being long rather
than for being tangled, and table-driven tests are the style AGENTS.md asks for. A linter
that starts at a 100% suppression rate is measuring the wrong thing here. gocognit is
still configured and unenabled, and at min-complexity 15 it targets branching directly,
which is the check actually wanted.
golangci-lint is clean on all nine modules and make checks passes.
That leaves gocognit and wrapcheck as the only settings blocks for linters that are not
enabled.
Signed-off-by: atharrva01 <atharvaborade568@gmail.com>1 parent 7ec36f3 commit 31208a5
3 files changed
Lines changed: 60 additions & 39 deletions
File tree
- integration/nwo/txgen/model/api
- token/core/zkatdlog/nogh/v1/validator
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
129 | | - | |
130 | | - | |
131 | 130 | | |
132 | 131 | | |
133 | 132 | | |
134 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
135 | 147 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
157 | 151 | | |
158 | | - | |
159 | | - | |
160 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
161 | 180 | | |
162 | 181 | | |
163 | 182 | | |
164 | 183 | | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
170 | 191 | | |
171 | 192 | | |
172 | 193 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
| 138 | + | |
139 | 139 | | |
140 | 140 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
0 commit comments