Refactor repocheck

master
LEdoian 2 years ago
parent 42e1c32bd6
commit 3d6dd8fa43

@ -14,25 +14,32 @@
set -e set -e
has() {
what="$1"
type "$what" >/dev/null 2>&1 && return 0 || return 1
}
red() { red() {
tput setaf 1 has tput && tput setaf 1 || true # We are OK with dumb terminals
echo "$@" echo "$@"
tput sgr0 has tput && tput sgr0 || true
} }
has_reuse=$(type reuse >/dev/null 2>&1 && echo true || echo false) if has reuse; then
if $has_reuse; then
reuse lint reuse lint
else else
red "REUSE tool not found, skipping" red "REUSE tool not found, skipping"
fi fi
has_mypy=$(type mypy >/dev/null 2>&1 && echo true || echo false) if has mypy; then
if $has_mypy; then
mypy *.py mypy *.py
else else
red "Mypy not found, skipping" red "Mypy not found, skipping"
fi fi
./test.py if has python3; then
./test.py
else
red 'WTF no python!'
fi

Loading…
Cancel
Save