pydocstyle
pydocstyle copied to clipboard
Inline ignore not working correctly (also not with flake8)
pydocstyle is not obaying inline ignore comment flags # noqa: D for at least D403.
Versions:
$ python3 --version
Python 3.8.10
$ pydocstyle --version
6.1.1
$ flake8 --version
3.9.2 (flake8-docstrings: 1.6.0, pydocstyle: 6.1.1, mccabe: 0.6.1, pycodestyle: 2.7.0, pyflakes:
2.3.1) CPython 3.8.10 on Linux
Input:
"""MWE."""
def multiline(): # noqa: D401
"""Main entry point run on the clients and interacting with our cloud API.
foo bar bar foo
"""
...
def oneline(): # noqa: D401
"""Main entry point run on the clients and interacting with our API."""
...
def ignore_all_D(): # noqa: D
"""Main entry point run on the clients and interacting with our API."""
...
def ignore_all(): # noqa
"""Main entry point run on the clients and interacting with our API."""
...
def other(): # noqa
"""lower case and no period"""
Expected result: no errors reported
Actual result:
$ pydocstyle doclint-ignore.py
doclint-ignore.py:15 in public function `ignore_all_D` (skipping D):
D401: First line should be in imperative mood; try rephrasing (found 'Main')
Also there is a problem with flake8-docstrings which might be connected, I have reported it here: #54
flake8 --select D doclint-ignore.py
doclint-ignore.py:4:1: D401 First line should be in imperative mood; try rephrasing
doclint-ignore.py:11:1: D401 First line should be in imperative mood; try rephrasing
doclint-ignore.py:15:1: D401 First line should be in imperative mood; try rephrasing
doclint-ignore.py:19:1: D401 First line should be in imperative mood; try rephrasing
doclint-ignore.py:23:1: D400 First line should end with a period
doclint-ignore.py:23:1: D403 First word of the first line should be properly capitalized