Last active
July 18, 2024 07:08
-
-
Save izikeros/7d63f4047e16b980647f41bab9575949 to your computer and use it in GitHub Desktop.
[Git pre-commit hooks adding flake8 and isort checks] Place them in .githooks subdirectory of main project directory. #git #isort #flake8 #pre-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
#!/usr/bin/env python | |
import sys | |
from isort.hooks import git_hook | |
sys.exit(git_hook(strict=True, modify=True)) |
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
set -e | |
# Run flake8 | |
flake8 . | |
python ./.githooks/isort_hooks.py |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment