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

Commit

Permalink
Merge branch 'master' into indent
Browse files Browse the repository at this point in the history
  • Loading branch information
samj1912 committed Jul 5, 2020
2 parents eb8d312 + 75dabda commit ab65c6b
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -55,7 +55,7 @@ Run
Links
-----

* `Read the full documentation here <http://pydocstyle.org>`_.
* `Read the full documentation here <http://pydocstyle.org/en/stable/>`_.

* `Fork pydocstyle on GitHub <http://github.com/PyCQA/pydocstyle>`_.

Expand Down
2 changes: 2 additions & 0 deletions docs/release_notes.rst
Expand Up @@ -16,6 +16,8 @@ Bug Fixes
* Update convention support documentation (#386, #393)
* Detect inner asynchronous functions for D202 (#467)
* Fix indentation error while parsing class methods (#441).
* Fix a bug in parsing Google-style argument description.
The bug caused some argument names to go unreported in D417 (#448).


5.0.2 - January 8th, 2020
Expand Down
6 changes: 3 additions & 3 deletions src/pydocstyle/checker.py
Expand Up @@ -96,9 +96,9 @@ class ConventionChecker:
r"(\w+)" # Followed by 1 or more unicode chars, numbers or underscores
# The above is captured as the first group as this is the paramater name.
r"\s*" # Followed by 0 or more whitespace characters
r"\(?(.*?)\)?" # Matches patterns contained within round brackets.
# The `(.*?)` is the second capturing group which matches any sequence of
# characters in a non-greedy way (denoted by the `*?`)
r"(\(.*?\))?" # Matches patterns contained within round brackets.
# The `.*?`matches any sequence of characters in a non-greedy
# way (denoted by the `*?`)
r"\s*" # Followed by 0 or more whitespace chars
r":" # Followed by a colon
".+" # Followed by 1 or more characters - which is the docstring for the parameter
Expand Down
2 changes: 1 addition & 1 deletion src/pydocstyle/config.py
Expand Up @@ -463,7 +463,7 @@ def _expand_error_codes(code_parts):
'known errors: %s', part)
expanded_codes.update(codes_to_add)
except TypeError as e:
raise IllegalConfiguration(e)
raise IllegalConfiguration(e) from e

return expanded_codes

Expand Down
30 changes: 30 additions & 0 deletions src/tests/test_cases/sections.py
Expand Up @@ -354,6 +354,36 @@ def test_missing_args_static_method(a, x, y, _test, z=3): # noqa: D213, D407
"""

@staticmethod
@expect("D417: Missing argument descriptions in the docstring "
"(argument(s) a, b are missing descriptions in "
"'test_missing_docstring' docstring)", arg_count=2)
def test_missing_docstring(a, b): # noqa: D213, D407
"""Test a valid args section.
Args:
a:
"""

@staticmethod
@expect("D417: Missing argument descriptions in the docstring "
"(argument(s) skip, verbose are missing descriptions in "
"'test_missing_docstring_another' docstring)", arg_count=2)
def test_missing_docstring_another(skip, verbose): # noqa: D213, D407
"""Do stuff.
Args:
skip (:attr:`.Skip`):
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Etiam at tellus a tellus faucibus maximus. Curabitur tellus
mauris, semper id vehicula ac, feugiat ut tortor.
verbose (bool):
If True, print out as much infromation as possible.
If False, print out concise "one-liner" information.
"""


@expect(_D213)
@expect("D417: Missing argument descriptions in the docstring "
Expand Down

0 comments on commit ab65c6b

Please sign in to comment.