Lint automatically with hooks
Follow the steps to create a pre-commit hook
Create the file
pre-commit
inside the path.git/hooks/
of your local repository with this content:
#!/bin/bash
ROOT_DIR="$(git rev-parse --show-toplevel)"
echo "Running Flake8"
flake8 ${ROOT_DIR} --statistics
Assign it execution permission
$ chmod +x .git/hooks/pre-commit
Last updated