-
-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Option to ignore nested functions #11
Comments
Thanks for the request! Would the # sample.py
"""Sample module-level docs"""
def top_level_func():
"""A top level function"""
def inner_func():
pass $ interrogate -r inner_func tests/functional/sample/full.py -vv
=== Coverage for /Users/lynn/dev/interrogate/tests/functional/sample/ ====
--------------------------- Detailed Coverage ----------------------------
| Name | Status |
|-------------------------------------------|----------------------------|
| full.py (module) | COVERED |
| top_level_func (L5) | COVERED |
|-------------------------------------------|----------------------------|
-------------------------------- Summary ---------------------------------
| Name | Total | Miss | Cover | Cover% |
|----------------|-------------|------------|-------------|--------------|
| full.py | 2 | 0 | 2 | 100% |
|----------------|-------------|------------|-------------|--------------|
| TOTAL | 2 | 0 | 2 | 100.0% |
------------ RESULT: PASSED (minimum: 80.0%, actual: 100.0%) ------------- |
In theory, yes -- but that would require me to hardcode all of the inner functions, since they usually don't follow any systematic naming scheme. That's something I'd like to avoid when working on a larger code base. Ignoring the nested functions completely (just like, say, magic functions) would be much easier. It's not something that's a deal breaker for me, but it would be a welcome addition. |
Ah, understood - I'll see if I can figure something out. Thanks for the idea! |
Hey @torfsen - I've added this feature for ya in #24 via a new flag:
I'll update this issue once it is released on PyPI either way. |
I've released 1.2.0 with this feature included - thank you for the suggestion! |
Addresses feature request econchick/interrogate#11
Is this a BUG REPORT or FEATURE REQUEST?:
Description of Bug or Feature
Nested functions (i.e. function definitions within function definitions) are usually small helpers that need no docstring and are not part of the public API. It should therefore be possible to optionally ignore them.
The text was updated successfully, but these errors were encountered: