Skip to content

Instantly share code, notes, and snippets.

@typenil typenil/pre-commit
Created Dec 13, 2018

What would you like to do?
Apply Black formatting before every commit
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
You can’t perform that action at this time.