How to exclude functions matching a pattern from D100 error?
See original GitHub issueI have a few functions on a legacy code base named call
that do not have a docstring. I would like to be able to specify that I do not want to check for docstring presence for the functions named call
. It would be helpful to have an extra configuration with the whitelist of such functions. Adding # noqa
comment is not an option.
Is it something already supported? If not, I would love to see this feature implemented. Is it something that I could implement relatively easy in the source code for submitting a PR?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Usage — pydocstyle 1.0.0 documentation
for example: --select=D101,D2 --ignore=<codes> choose the basic list of checked errors by specifying which errors to ignore out of all of the available...
Read more >How can I exclude factors containing a certain symbol form ...
I can't think of a pattern that would match any expression that contains an x somewhere without using FreeQ or MemberQ as conditions....
Read more >pydocstyle Documentation - Read the Docs
Support the option to exclude all error codes. Running pep257 with --select= (or select= in the con- figuration file) will exclude all errors...
Read more >pydocstyle Documentation - manpages.ubuntu!
Error Check Options: Only one of --select, --ignore or --convention can be ... Example [pydocstyle] inherit = false ignore = D100,D203,D405 match =...
Read more >Regex Pattern to Match, Excluding when... / Except between
In other flavors, within the replacement function call, inspect the match using a callback or lambda, and replace if Group 1 is set....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@AlexArcPy that’s great. Sorry for the push back, but as with any open source project, each user has their own unique use case and we need to make sure features are applicable to a large portion of them to avoid feature creep and to keep the code maintainable.
Cheers!
For magic methods there’s a separate error code specifically designed for this common use case. But the main reason we handle that case is that the APIs for these methods is known from their name.
In your example, say,
read_cli_args
, I think there’s still reason to document the function: does it return a value? In what format? What’s the behavior for invalid CLI flags? etc., etc.If your general opinion is “some constructs do not need docstrings because their name is self-explanatory”, you can simply turn off all of the
D1xx
“missing docstring” error codes.