Created
February 22, 2022 00:11
-
-
Save adigitoleo/57c59edcd5180d431efdeceb5471eb73 to your computer and use it in GitHub Desktop.
Python black pre-commit hook
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 | |
# Copy or link this script into .git/hooks/ | |
# It runs automatically in the project root directory (parent of .git/). | |
# Code formatting | |
if black --check src/pydrex; then | |
exit 0 | |
else | |
black src/pydrex | |
git add -u | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment