Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Commit fec1b89

Browse files
sambhavNurdok
authored andcommitted
Remove D413 from the pep257 convention (#404)
* Remove D413 from the pep257 convention * Add tests for D413/PEP257 and update release notes
1 parent c20721b commit fec1b89

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

docs/release_notes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ New Features
1616
* Extend support for detecting missing arguments in Google style
1717
docstrings to method calls (#384).
1818

19+
Bug Fixes
20+
21+
* Remove D413 from the pep257 convention (#404).
22+
1923
4.0.1 - August 14th, 2019
2024
-------------------------
2125

src/pydocstyle/violations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def __getattr__(self, item: str) -> Any:
266266
conventions = AttrDict({
267267
'pep257': all_errors - {'D203', 'D212', 'D213', 'D214', 'D215', 'D404',
268268
'D405', 'D406', 'D407', 'D408', 'D409', 'D410',
269-
'D411', 'D415', 'D416', 'D417'},
269+
'D411', 'D413', 'D415', 'D416', 'D417'},
270270
'numpy': all_errors - {'D107', 'D203', 'D212', 'D213', 'D402', 'D413',
271271
'D415', 'D416', 'D417'},
272272
'google': all_errors - {'D203', 'D204', 'D213', 'D215', 'D400', 'D401',

src/tests/test_integration.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,19 @@ class Foo(object):
561561
"""Docstring for this class"""
562562
def foo():
563563
pass
564+
565+
566+
# Original PEP-257 example from -
567+
# https://www.python.org/dev/peps/pep-0257/
568+
def complex(real=0.0, imag=0.0):
569+
"""Form a complex number.
570+
571+
Keyword arguments:
572+
real -- the real part (default 0.0)
573+
imag -- the imaginary part (default 0.0)
574+
"""
575+
if imag == 0.0 and real == 0.0:
576+
return complex_zero
564577
'''))
565578

566579
env.write_config(convention="pep257")
@@ -571,6 +584,7 @@ def foo():
571584
assert 'D203' not in out
572585
assert 'D212' not in out
573586
assert 'D213' not in out
587+
assert 'D413' not in out
574588

575589

576590
def test_numpy_convention(env):

0 commit comments

Comments
 (0)