Answer the question
In order to leave comments, you need to log in
How to set up git-precommit hooks for a python project?
I can't figure out why it doesn't work.
I took sample, renamed it to pre-commit, left the standard ones.
Added below:
echo hahaha
touched_python_files=`git diff --cached --name-only |egrep '\.py$' || true`
autopep8 -v \
--in-place \
--aggressive \
$touched_python_files
nosetests
code=$?
if [ "$code" == "0" ]; then
exit 0
fi
echo -n "Not all tests pass. Commit (y/n): "
read response
if [ "$response" == "y" ]; then
exit 0
fi
exit $code
git-pylint-commit-hook
Answer the question
In order to leave comments, you need to log in
I can assume that there is an environment for the project and it is not activated...
(pylint is paranoid! it's hard to work with it every day, once every six months for the sake of interest - it's normal)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question