Created
December 13, 2018 22:22
-
-
Save matt-fff/14eb5fbd68798bc1aa8179d96d1cc378 to your computer and use it in GitHub Desktop.
Apply Black formatting before every commit
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
git diff --cached --name-status | grep -v '^D' | grep '.py' | sed 's/[A-Z][ \t]*//' | xargs black 2>&1 | grep '^reformatted' | sed 's/reformatted[ \t]//' | xargs git add |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment