-
-
Notifications
You must be signed in to change notification settings - Fork 161
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
Unify CLIs #537
Unify CLIs #537
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!!
Stefan is back and will take a look at this soon. He is a little backlogged. Thanks for your patience. |
Thank you very much @stefmolin. I see that I get a traceback when no import path is specified. I think I suggested the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I think the lint
subparser perhaps needs to be hooked up more cleanly, but tested everything locally and it works. Thank you again!
numpydoc/cli.py
Outdated
|
||
validate = subparsers.add_parser( | ||
"validate", | ||
description="Validate the docstring with numpydoc.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we clarify here the distinction between validate
and lint
. They do the same, except the one operates on a function and the other on a file? But validate
doesn't allow disabling certain rules, which confused me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it works for non-functions as well. How about this?
Validate an object's docstring conforms to the numpydoc standard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what to do about the second part of your comment. If you run numpydoc validate --help
you see what can be passed as arguments, and there aren't any for disabling rules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Validate that an object's docstring conforms to the numpydoc standard" (added "that")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or, "Determine (or check?) whether an object's docstring..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise just: "Validate an object's docstring against the numpydoc standard"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may prefer the last version, but anything gramatically sound is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what to do about the second part of your comment. If you run
numpydoc validate --help
you see what can be passed as arguments, and there aren't any for disabling rules.
This was more of a question: should there be the option of disabling certain rules? Why are these not exactly equivalent in their functionality?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what to do about the second part of your comment. If you run
numpydoc validate --help
you see what can be passed as arguments, and there aren't any for disabling rules.This was more of a question: should there be the option of disabling certain rules? Why are these not exactly equivalent in their functionality?
While I agree this should eventually be the case, this definitely seems out of scope for this PR. At least the separate subcommands will not draw attention to arguments that have no effect like before (see #459).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @stefmolin! The new interface is great.
@rossbar @jarrodmillman handing it over to you. |
Changes:
numpydoc
entry point (replacing the hook's entry point).__main__.py
and into a dedicatedcli.py
file.git
:render
,validate
, andlint
.test_main.py
for changes and addition oflint
option.-m
option from the hook, so that usage is now fromnumpydoc lint
.numpydoc lint
.test.yml
workflow, but I didn't add a correspondinglint
command as I don't fully understand what that part does.Closes #467