pydocstyle icon indicating copy to clipboard operation
pydocstyle copied to clipboard

error on invalid/unused `noqa` comments

Open DetachHead opened this issue 3 years ago • 2 comments

# should be an error, invalid code
def foo():  # noqa: asdf
    ...

# should be an error, noqa comment has no effect
def bar():  # noqa: D103
    """asdf"""

# should be an error, a space is required after the colon, so this just ignores all errors not just D103
def baz():  # noqa:D103
    ...

DetachHead avatar Feb 20 '23 02:02 DetachHead

But my package 'pyasdfstyle' would have reported an error on the first function foo:

Function not named 'asdf' [asdf]

There would be no way to differentiate between the errors for pydocstyle and the errors for pyasdfstyle.

KotlinIsland avatar May 09 '23 03:05 KotlinIsland

it shouldn't be reusing the same ignore comments that other linters use in the first place

DetachHead avatar May 09 '23 03:05 DetachHead