This repository was archived by the owner on Nov 3, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +12
-12
lines changed Expand file tree Collapse file tree 4 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -19,9 +19,9 @@ New Features
1919* Added the ability to ignore specific function and method doctstrings with
2020 comments:
2121
22- 1. "# noqa" or "# pydocstyle: noqa" skips all checks.
22+ 1. "# noqa" skips all checks.
2323
24- 2. "# pydocstyle : D102,D203" can be used to skip specific checks.
24+ 2. "# noqa : D102,D203" can be used to skip specific checks.
2525
2626Bug Fixes
2727
Original file line number Diff line number Diff line change 11``pydocstyle `` inline commenting to skip specific checks on specific
22functions or methods. The supported comments that can be added are:
33
4- 1. ``"# noqa" `` or `` "# pydocstyle: noqa" `` skips all checks.
4+ 1. ``"# noqa" `` skips all checks.
55
6- 2. ``"# pydocstyle: D102,D203" `` can be used to skip specific checks.
6+ 2. ``"# noqa: D102,D203" `` can be used to skip specific checks. Note that
7+ this is compatible with skips from `flake8 <http://flake8.pycqa.org/ >`_,
8+ e.g. ``# noqa: D102,E501,D203 ``.
79
810For example, this will skip the check for a period at the end of a function
911docstring::
1012
11- >>> def bad_function(): # pydocstyle : D400
13+ >>> def bad_function(): # noqa : D400
1214 ... """Omit a period in the docstring as an exception"""
1315 ... pass
Original file line number Diff line number Diff line change @@ -472,12 +472,10 @@ def parse_definition(self, class_):
472472 skips = ''
473473 if self .current .kind in (tk .NEWLINE , tk .COMMENT ):
474474 if self .current .kind == tk .COMMENT :
475- if self .current .value .startswith ('# noqa' ) or \
476- 'pydocstyle: noqa' in self .current .value :
475+ if 'noqa: ' in self .current .value :
476+ skips = '' .join (self .current .value .split ('noqa: ' )[1 :])
477+ elif self .current .value .startswith ('# noqa' ):
477478 skips = 'all'
478- elif 'pydocstyle: ' in self .current .value :
479- skips = '' .join (self .current .value .split (
480- 'pydocstyle: ' )[1 :])
481479 self .leapfrog (tk .INDENT )
482480 assert self .current .kind != tk .INDENT
483481 docstring = self .parse_docstring ()
Original file line number Diff line number Diff line change @@ -352,13 +352,13 @@ def docstring_bad_ignore_all(): # noqa
352352 pass
353353
354354
355- def docstring_bad_ignore_all_2 (): # pydocstyle: noqa
355+ def docstring_bad_ignore_one (): # noqa: D400,D401
356356 """Runs something"""
357357 pass
358358
359359
360360@expect ("D401: First line should be in imperative mood ('Run', not 'Runs')" )
361- def docstring_bad_ignore_one (): # pydocstyle: D400
361+ def docstring_ignore_violations_of_pydocstyle_D400_and_PEP8_E501_but_catch_D401 (): # noqa: E501, D400
362362 """Runs something"""
363363 pass
364364
You can’t perform that action at this time.
0 commit comments