#!/bin/sh # Is pycodestyle is installed? which pycodestyle &> /dev/null if [[ $? -ne 0 ]]; then cat <<-EOF pre-commit hook failed. pycodestyle is not installed. Run the following and try your commit again: pip install pycodestyle EOF exit 1 fi # Run pycodestyle to check pep8 conformance. pycodestyle if [[ $? -ne 0 ]]; then echo pycodestyle failed in pre-commit hook. echo Fix errors and retry commit. exit 1 fi