-
-
Notifications
You must be signed in to change notification settings - Fork 166
Check GL08 on class __init__ constructors #591
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
Comments
In case it wasn't clear, |
That makes sense to me. |
Hey all (@larsoner, @stefanv), I have re-opened the issue as the current implementation is not working with the When we improved the class constructor init GL08 reporting, we only wrote tests for the However, under the implementation of the abstract syntax tree (ast) validator ( Here's the way we get currently (roughly) get the class reference from the constructor:
Any ideas what we should do for the The
This seems quite convoluted just to get the parent class for the constructor. What are your thoughts? |
Further discussion on this, should all tests in test_validate also be written/run with AstValidator in mind? |
@stefanv Is it just me or are we not properly testing hook validation at all? I searched the I also wonder if our hook tests ought to be consistent with the regular tests, particularly given the unique AST traversal? Wondering if we can consolidate tests into some example files so both AST and regular Validator functionality can be routinely verified? (edit) Could #556 be the reason and affecting our CI testing as well? |
@mattgebert We run the tests using two different invocations:
and
The latter happens on the BTW, the naming of that job made perfect sense when @jarrodmillman added it. But, it looks like it has been modified in 342bdce not to install pre-releases, so now makes less sense. We should probably re-introduce the I haven't looked at the AST vs regular validator for a long time, and the details escape me now. I thought the AST validator did additional tests on top of the docstring validation (such as whether all arguments are documented). Ideally, we then shouldn't need to test the same functionality twice, once in the Validator and another time in ASTValidator?
|
I was looking for a way to skip GL08 checks on class constructors (
__init__
) throughout my code. This is particularly as the numpydoc recommendation for class strings documents the constructor:It seems that there ought to be a default check ignore for
__init__
constructors if no docstring has been provided (and if a class docstring has been provided). Obviously if an (optional) docstring for__init__
has been created, then it ought to be checked.This conditional checking doesn't seem possible with the default
override_<code>
,exclude
toml tags.Keen to hear others thoughts!
The text was updated successfully, but these errors were encountered: