Summary
I use ruff and pylint.
I used to have to ignore errors for each on the same line, so I added the following ignore:
"""Demonstrate ruff removal of pylint disable."""
import ast
class A(ast.NodeVisitor):
"""Subclass of ast.NodeVisitor."""
def visit_ImportFrom( # noqa: N802, pylint: disable=invalid-name
self,
node: ast.ImportFrom,
) -> None:
"""Override method."""
ruff check --select=ALL ruff_example.py gives:
RUF100 [*] Unused `noqa` directive (unused: `N802`)
--> ruff_example.py:9:28
|
7 | """Subclass of ast.NodeVisitor."""
8 |
9 | def visit_ImportFrom( # noqa: N802, pylint: disable=invalid-name
| ^^^^^^^^^^^^
10 | self,
11 | node: ast.ImportFrom,
|
help: Remove unused `noqa` directive
Found 1 error.
[*] 1 fixable with the `--fix` option.
Adding --fix unexpectedly removes the pylint disable part of the comment (meaning that pylint errors).
Version
0.14.0
Summary
I use
ruffandpylint.I used to have to ignore errors for each on the same line, so I added the following ignore:
ruff check --select=ALL ruff_example.pygives:Adding
--fixunexpectedly removes thepylintdisable part of the comment (meaning thatpylinterrors).Version
0.14.0