#!/bin/bash set -e cd "$(dirname "$(readlink "$0")")" sources=($@) if [ "${#sources[@]}" -eq 0 ]; then sources=(src) fi rc=0 run() { # remember last failure if "$@"; then :; else rc=$?; fi } echo "[pycodestyle]" run pycodestyle --config=.pycodestyle "${sources[@]}" echo "[pyflakes]" run python3 -m pyflakes "${sources[@]}" echo "[mypy]" run mypy "${sources[@]}" echo "[black]" run python3 -m black --check "${sources[@]}" echo "[isort]" run python3 -m isort --check-only "${sources[@]}" exit $rc