PyCQA / pydocstyle

docstring style checker
http://pydocstyle.org
MIT License
1.11k stars 188 forks source link

error on invalid/unused `noqa` comments #633

Open DetachHead opened 1 year ago

DetachHead commented 1 year ago
# 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
    ...
KotlinIsland commented 1 year ago

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.

DetachHead commented 1 year ago

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