Created
September 30, 2019 05:28
-
-
Save s-newman/1223f7ba3dcec4f380e26a3600642537 to your computer and use it in GitHub Desktop.
A git pre-commit hook script to automatically run the Black formatter for python.
This file contains 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 | |
# This relies on a installation of black within a python virtual environment named "black" located at ${HOME}/envs | |
# Copy me to ${PROJECT_DIR}/.git/hooks/pre-commit | |
# Then make me executable: | |
# $ chmod 744 ${PROJECT_DIR}/.git/hooks/pre-commit | |
${HOME}/envs/black/bin/black . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment