Conversation
|
Hi, thanks for creating this PR! I asked an AI coding assistant to review your code changes, and here's the suggestions by AI: PR #282 Review: "Add config option to skip private functions"SummaryThe PR adds a 🐛 Critical Bug: Spurious
|
- remove erroneous import - skip name mangled methods - update docs - add test for inner methods
|
Thanks for the feedback, I've addressed the comments:
|
| if ( | ||
| self.skipCheckingPrivateFunctions | ||
| and node.name.startswith("_") | ||
| and not (node.name.startswith("__") and node.name.endswith("__")) |
There was a problem hiding this comment.
Could you package this logic into a function in https://github.com/jsh9/pydoclint/blob/main/pydoclint/utils/generic.py and add some unit test cases?
This way, you don't need the comment below ("# Skip private functions, but not dunder methods.") because the function name is self explanatory enough.
There was a problem hiding this comment.
Done - and added tests in test_generic.py
| and node.name.startswith("_") | ||
| and not (node.name.startswith("__") and node.name.endswith("__")) | ||
| ): | ||
| # Skip private functions, but not dunder methods. |
There was a problem hiding this comment.
| # Skip private functions, but not dunder methods. |
You don't need this comment if the logic above is packaged into a function with clear naming.
|
|
||
| class TestClass: | ||
| """ | ||
| Docstring for TestClass, this will still be checked if skip-checking-short-docstrings is False |
There was a problem hiding this comment.
| Docstring for TestClass, this will still be checked if skip-checking-short-docstrings is False | |
| Docstring for TestClass, this will still be checked if | |
| skip-checking-short-docstrings is False |
nit: making lines shorter to improve readability
| """ | ||
|
|
||
| def __init__(self) -> None: | ||
| """This init will still be checked if skip-checking-short-docstrings is False""" |
There was a problem hiding this comment.
| """This init will still be checked if skip-checking-short-docstrings is False""" | |
| """This init will still be checked if | |
| skip-checking-short-docstrings is False""" |
nit: making lines shorter to improve readability
| bool: Always returns False | ||
| """ | ||
| def inner_method() -> bool: | ||
| """inner method should also be skipped as it is inside a private method. |
There was a problem hiding this comment.
| """inner method should also be skipped as it is inside a private method. | |
| """inner method should also be skipped as it is inside a | |
| private method. |
nit: making lines shorter to improve readability
| '33_private_functions/case.py', | ||
| { | ||
| 'style': 'google', | ||
| 'skipCheckingPrivateFunctions':True, |
There was a problem hiding this comment.
| 'skipCheckingPrivateFunctions':True, | |
| 'skipCheckingPrivateFunctions': True, |
If you run pre-commit run -a on the repo, you can automatically have these formatting issues fixed.
|
In addition to my comments above, could you make 2 additional small changes:
|
|
I think that should be all the changes. |
|
It appears updates to muff flagged a whole bunch of tests as improperly formatted. The latest commit fixes this but at the expense of bloating the PR size. |
Adds a flag to skip private functions from having their doc-strings linted:
skipCheckingPrivateFunctionsThis feature would be really great for my team's projects, hopefully you agree it is valuable - if anything isn't right please let me know.