PyCQA / pydocstyle

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

[bug] Disable D205 and D400 will make non-exist error #609

Closed Freed-Wu closed 2 years ago

Freed-Wu commented 2 years ago

Like #418, I create a test.py:

"""
Test
====

Common functions.
"""

def init() -> None:
    """init.

    :rtype: None
    """
    pass
❯ git commit
pydocstyle...............................................................Failed
- hook id: pydocstyle
- exit code: 1

a.py:1 at module level:
        D205: 1 blank line required between summary line and description (found 0)
a.py:1 at module level:
        D400: First line should end with a period (not 't')

Add ignore to pyproject.toml:

[tool.pydocstyle]
ignore = "D205, D400"

However, non-exist error occurs.

❯ git commit
pydocstyle...............................................................Failed
- hook id: pydocstyle
- exit code: 1

a.py:1 at module level:
        D212: Multi-line docstring summary should start at the first line
a.py:1 at module level:
        D415: First line should end with a period, question mark, or exclamation point (not 't')
a.py:10 in public function `init`:
        D213: Multi-line docstring summary should start at the second line
sigmavirus24 commented 2 years ago

You're replacing the default ignore list. That's why you get new errors. This is well documented

Freed-Wu commented 2 years ago
[tool.pydocstyle]
add_ignore = "D205, D400"

Thanks! I advise adding D205, D400 to default ignore list to close #418.