Commit 4f5425e
authored
fix: Ignore empty error codes from 'type: ignore' (#20052)
`type: ignore` comments with leading, trailing, or
repeated commas could lead to empty strings being parsed as valid
error codes.
This resulted in incorrect `[unused-ignore]` warnings when using the
`--warn-unused-ignores` flag, as the empty code '' was considered
a valid but unused ignore rule.
This commit improves the parsing logic to filter out any empty strings
that result from splitting the error codes.
fixes #200381 parent d7ffbb4 commit 4f5425e
2 files changed
+15
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
289 | | - | |
| 289 | + | |
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
121 | 135 | | |
122 | 136 | | |
123 | 137 | | |
| |||
0 commit comments