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

Commit 76d7ced

Browse files
committed
Updated the docstring for check.
1 parent 74e68b7 commit 76d7ced

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

src/pydocstyle/checker.py

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -388,13 +388,31 @@ def check_starts_with_this(self, function, docstring):
388388

389389

390390
def check(filenames, select=None, ignore=None):
391-
"""Generate PEP 257 errors that exist in `filenames` iterable.
391+
"""Generate docstring errors that exist in `filenames` iterable.
392392
393-
Only returns errors with error-codes defined in `checked_codes` iterable.
393+
By default, the PEP-257 convention is checked. To specifically define the
394+
set of error codes to check for, supply either `select` or `ignore` (but
395+
not both). In either case, the parameter should be a collection of error
396+
code strings, e.g., {'D100', 'D404'}.
394397
395-
Example
396-
-------
397-
>>> check(['pydocstyle.py'], checked_codes=['D100'])
398+
When supplying `select`, only specified error codes will be reported.
399+
When supplying `ignore`, all error codes which were not specified will be
400+
reported.
401+
402+
Note that ignored error code refer to the entire set of possible
403+
error codes, which is larger than just the PEP-257 convention. To your
404+
convenience, you may use `pydocstyle.violations.conventions.pep257` as
405+
a base set to add or remove errors from.
406+
407+
Examples
408+
---------
409+
>>> check(['pydocstyle.py'])
410+
<generator object check at 0x...>
411+
412+
>>> check(['pydocstyle.py'], select=['D100'])
413+
<generator object check at 0x...>
414+
415+
>>> check(['pydocstyle.py'], ignore=conventions.pep257 - {'D100'})
398416
<generator object check at 0x...>
399417
400418
"""

0 commit comments

Comments
 (0)