Last active
July 8, 2018 19:09
-
-
Save benman1/0bd78b473e7fd40e78a710fbb40a68f6 to your computer and use it in GitHub Desktop.
Fix a python repo that's completely out of date and badly formatted
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
find . -name '*.py' -exec dos2unix {} \; | |
find . -name '*.py' -exec 2to3 -w {} \; | |
find . -name '*.py' -exec autopep8 --in-place --aggressive --aggressive {} \; | |
find . -name '*.py' -exec docformatter --in-place {} \; | |
isort -rc --atomic . | |
find . -name '*.py' -exec vim -c '%s/except \(.*\), e:/except \1 as e:/' {} -c 'wq' \; | |
find . -name '*.py' -exec autoflake --in-place --remove-unused-variables {} \; | |
find . -name '*.py' -exec vim -c '%s/xrange/range/' {} -c 'wq' \; | |
# also check unicode, ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment