-
Notifications
You must be signed in to change notification settings - Fork 188
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
Allow running codemods without configuring in YAML #879
Conversation
👍 |
I'm in favor of this functionality, but
(feel free to come up with a better name 😄 ) |
@zsol How about a flag to allow the fallback behavior?
( |
What's the benefit of that over the explicit behavior I mentioned above? |
@zsol Yeah, good point – I was about to edit my comment to a "never mind" because I realized that was silly after all, but you got there first 😁 Anyway, um... are there tests for the CLI at all? |
51e1488
to
23d78e0
Compare
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 great, thanks!
) | ||
return 1 | ||
else: |
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.
Nit: this else block is not needed, we can just dedent the entire block since we always return in the if branch
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.
Um... no, we don't return
from the if args.external
branch?
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.
Oh you're absolutely right 😂
This enables codemodding things by just plonking a CodemodCommand class into any old importable module and running `python -m libcst.tool codemod -x some_module.SomeClass ...`
Thanks! |
Summary
This enables codemodding things by just plonking a CodemodCommand class into any old importable module and running
python -m libcst.tool codemod -x some_module.SomeClass ...