mirror of
https://github.com/Guake/guake.git
synced 2025-10-26 11:27:13 +00:00
21 lines
612 B
Bash
Executable File
21 lines
612 B
Bash
Executable File
#!/bin/bash
|
|
|
|
[ -z "$REVRANGE" ] && REVRANGE="master..HEAD^1"
|
|
|
|
# get a list of changed files, used below; this uses a tempfile to work around
|
|
# shell behavior when piping to 'while'
|
|
tempfile=$(mktemp -t tmp.XXXXXX)
|
|
trap "rm -f ${tempfile}; exit 1" 1 2 3 15
|
|
|
|
git diff --name-only $REVRANGE | grep '\.py$' > ${tempfile}
|
|
|
|
py_files=()
|
|
while read line; do
|
|
if [[ -f "${line}" ]]; then
|
|
echo "fast-styling ${line}"
|
|
pipenv run fiximports ${line};
|
|
pipenv run autopep8 --in-place --recursive setup.py ${line}
|
|
pipenv run yapf --style .yapf --recursive -i ${line}
|
|
fi
|
|
done < ${tempfile}
|