mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 06:50:29 +03:00
Merge branch 'precommit-fixes' into 'master'
pre-commit script fixes See merge request !145
This commit is contained in:
commit
0f708f367c
1 changed files with 12 additions and 11 deletions
|
|
@ -59,12 +59,12 @@ fi
|
||||||
PEP8_IGNORE="E123,E501,W503"
|
PEP8_IGNORE="E123,E501,W503"
|
||||||
|
|
||||||
err() {
|
err() {
|
||||||
echo ERROR: "$@"
|
echo >&2 ERROR: "$@"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
warn() {
|
warn() {
|
||||||
echo WARNING: "$@"
|
echo >&2 WARNING: "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd_exists() {
|
cmd_exists() {
|
||||||
|
|
@ -72,20 +72,21 @@ cmd_exists() {
|
||||||
}
|
}
|
||||||
|
|
||||||
find_command() {
|
find_command() {
|
||||||
local name=$1
|
for name in $@; do
|
||||||
for suff in "3" "-python3" ""; do
|
for suff in "3" "-python3" ""; do
|
||||||
cmd=${1}${suff}
|
cmd=${name}${suff}
|
||||||
if cmd_exists $cmd; then
|
if cmd_exists $cmd; then
|
||||||
echo $cmd
|
echo $cmd
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
done
|
||||||
warn "$1 is not installed, using dummy placeholder!"
|
warn "$1 is not installed, using dummy placeholder!"
|
||||||
echo -n echo
|
echo :
|
||||||
}
|
}
|
||||||
|
|
||||||
PYFLAKES=$(find_command pyflakes)
|
PYFLAKES=$(find_command pyflakes)
|
||||||
PEP8=$(find_command pep8)
|
PEP8=$(find_command pycodestyle pep8)
|
||||||
|
|
||||||
if [ "$PY_FILES $PY_TEST_FILES" != " " ]; then
|
if [ "$PY_FILES $PY_TEST_FILES" != " " ]; then
|
||||||
if ! $PYFLAKES $PY_FILES $PY_TEST_FILES; then
|
if ! $PYFLAKES $PY_FILES $PY_TEST_FILES; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue