Skip to content

Instantly share code, notes, and snippets.

@izikeros
Last active July 18, 2024 07:08
Show Gist options
  • Save izikeros/7d63f4047e16b980647f41bab9575949 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python
import sys
from isort.hooks import git_hook
sys.exit(git_hook(strict=True, modify=True))
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