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
19
19
* Added the ability to ignore specific function and method doctstrings with
20
20
comments:
21
21
22
- 1. "# noqa" or "# pydocstyle: noqa" skips all checks.
22
+ 1. "# noqa" skips all checks.
23
23
24
- 2. "# pydocstyle : D102,D203" can be used to skip specific checks.
24
+ 2. "# noqa : D102,D203" can be used to skip specific checks.
25
25
26
26
Bug Fixes
27
27
Original file line number Diff line number Diff line change 1
1
``pydocstyle `` inline commenting to skip specific checks on specific
2
2
functions or methods. The supported comments that can be added are:
3
3
4
- 1. ``"# noqa" `` or `` "# pydocstyle: noqa" `` skips all checks.
4
+ 1. ``"# noqa" `` skips all checks.
5
5
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 ``.
7
9
8
10
For example, this will skip the check for a period at the end of a function
9
11
docstring::
10
12
11
- >>> def bad_function(): # pydocstyle : D400
13
+ >>> def bad_function(): # noqa : D400
12
14
... """Omit a period in the docstring as an exception"""
13
15
... pass
Original file line number Diff line number Diff line change @@ -472,12 +472,10 @@ def parse_definition(self, class_):
472
472
skips = ''
473
473
if self .current .kind in (tk .NEWLINE , tk .COMMENT ):
474
474
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' ):
477
478
skips = 'all'
478
- elif 'pydocstyle: ' in self .current .value :
479
- skips = '' .join (self .current .value .split (
480
- 'pydocstyle: ' )[1 :])
481
479
self .leapfrog (tk .INDENT )
482
480
assert self .current .kind != tk .INDENT
483
481
docstring = self .parse_docstring ()
Original file line number Diff line number Diff line change @@ -352,13 +352,13 @@ def docstring_bad_ignore_all(): # noqa
352
352
pass
353
353
354
354
355
- def docstring_bad_ignore_all_2 (): # pydocstyle: noqa
355
+ def docstring_bad_ignore_one (): # noqa: D400,D401
356
356
"""Runs something"""
357
357
pass
358
358
359
359
360
360
@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
362
362
"""Runs something"""
363
363
pass
364
364
You can’t perform that action at this time.
0 commit comments