-
-
Notifications
You must be signed in to change notification settings - Fork 167
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?
|
Sorry it's been a while. I've added (#622) a fix and updated test to ensure the AST Validation functionality is also checked.
Sounds good, let's fix this up and add some extra commits to #622 to ensure this is on track.
I don't believe there are any additional validation checks, but there are tests for the use of configs (toml, setup) which seem useful. (hook testing goes like: I get the impression that the many docstring examples in For the meantime, I've modified the |
…ase installation, and changed pytest invocation to use `numpydoc` instead of `.`, for consistency with `test` job In response to discussion on numpy#591
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: