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
Run on a file or directory #40
Comments
I'd suggest using pre-commit to run Your "workaround" would be my other suggestion -- no need to make a tool more complicated than it needs to be if there's another tool which does exactly what you need. Adding directory recursion is a surprising amount of complexity, you then need to handle exclusion, inclusion, globs, walking, ordering, and a bunch of other problems I'm not interested in solving (again) (because |
@asottile - thank you for this wonderful tool! I would also find this option useful to pass a folder. Yes, it's a bit of code to walk the directories, but It's not obvious to me why one would use |
My workaround now also checks the found thing is a file (once pyupgrade `find . -name "*.py" -type f` |
It's not just a one time tool, it will continue to enforce the rewrites into the future (and gain features over time). You don't want to have to manually point out "this code base is python 3+ don't do X" in code reviews ad infinitum. Even if you don't want to have hooks indefinitely, |
Hi @asottile I understand that you are advocating for pre-commit but I believe it would be good to mention the trick with |
that has some correctness and portability issues, slightly better is I don't really think it's the readme's place to teach how to use unix commands |
Alright that's your call :) Thanks for the quick feedback and for the library |
Thanks for this handy tool!
It would be nice to be able to run pyupgrade on a directory, and have it process all .py files in that directory and subdirectories.
For example:
pyupgrade .
This would be similar to other tools like Flake8 and Black.
In the meantime, this works:
pyupgrade `find . -name "*.py"`
The text was updated successfully, but these errors were encountered: