pull/104/head
shippingwang 2020-05-06 14:47:15 +00:00
parent bfcd9e4dce
commit fed2304690
1 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,21 @@
#!/bin/bash
function abort(){
echo "Your commit does not fit PaddlePaddle code style" 1>&2
echo "Please use pre-commit scripts to auto-format your code" 1>&2
exit 1
}
trap 'abort' 0
set -e
cd `dirname $0`
cd ..
export PATH=/usr/bin:$PATH
pre-commit install
if ! pre-commit run -a ; then
ls -lh
git diff --exit-code
exit 1
fi
trap : 0