question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to exclude functions matching a pattern from D100 error?

See original GitHub issue

I 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:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Nurdokcommented, Mar 14, 2019

@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!

1reaction
Nurdokcommented, Mar 14, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found