docker: leverage Git to run formatting checks only on changed files

This commit is contained in:
Tiziano Müller 2019-09-26 14:48:34 +02:00 committed by Tiziano Müller
parent 7c296290a2
commit b7e6611d7a
6 changed files with 52 additions and 25 deletions

View file

@ -24,12 +24,6 @@ rm -rf /var/lib/apt/lists/*
pip install --quiet numpy matplotlib requests
pip3 install --quiet numpy matplotlib requests pre-commit
# register the pre-commit hooks
cd /workspace/cp2k
echo -n "Warming cache by trying to run pre-commit hooks... "
if pre-commit run --all-files --hook-stage manual check-ast &> /dev/null ; then
echo "done."
else
echo "failed."
fi
#EOF
pre-commit install --install-hooks