joinmarket/test/lint/lint-python.sh

18 lines
438 B
Bash
Raw Permalink Normal View History

2021-04-15 19:54:48 +03:00
#!/usr/bin/env bash
# Based on Bitcoin Core's test/lint/lint-python.sh
# The python files in jmqtui/jmqtui are auto generated.
2023-10-06 22:21:24 +02:00
EXCLUDE_PATTERNS="src/jmqtui/*.py"
2021-04-15 19:54:48 +03:00
if ! command -v flake8 > /dev/null; then
echo "Skipping Python linting since flake8 is not installed."
exit 0
fi
if [[ $# == 0 ]]; then
2022-12-29 09:02:00 +02:00
# shellcheck disable=SC2046
flake8 $(git ls-files "*.py") --extend-exclude "${EXCLUDE_PATTERNS}"
2021-04-15 19:54:48 +03:00
else
flake8 "$@"
fi