Browse Source

Add flake8 linter script

master
Kristaps Kaupe 5 years ago
parent
commit
ab439617f3
No known key found for this signature in database
GPG Key ID: 33E472FE870C7E5D
  1. 16
      test/lint/lint-python.sh

16
test/lint/lint-python.sh

@ -0,0 +1,16 @@
#!/usr/bin/env bash
# Based on Bitcoin Core's test/lint/lint-python.sh
if ! command -v flake8 > /dev/null; then
echo "Skipping Python linting since flake8 is not installed."
exit 0
elif flake8 --version | grep -q "Python 2"; then
echo "Skipping Python linting since flake8 is running under Python 2. Install the Python 3 version of flake8."
exit 0
fi
if [[ $# == 0 ]]; then
flake8 $(git ls-files "*.py")
else
flake8 "$@"
fi
Loading…
Cancel
Save