aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2019-06-03 23:20:52 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2019-06-03 23:21:47 +0200
commitd3a1c2502bb19d667c692937784fe027fd8d32da (patch)
tree3ab91c5bf5c6804eb8101ec37cdcb793e9a5da6e /test
parent652033008755224112e14d7ab6336f8a9be757be (diff)
parent3c5254a820c892b448dfb42991f6109a032a3730 (diff)
Merge #16124: tests: Limit Python linting to files in the repo
3c5254a820c892b448dfb42991f6109a032a3730 Limit Python linting to files in the repo (practicalswift) Pull request description: Limit Python linting to files in the repo. Before: ``` $ test/lint/lint-python.sh not_under_version_control.py:195:9: F841 local variable 'e' is assigned to but never used $ ``` After: ``` $ test/lint/lint-python.sh $ ``` ACKs for commit 3c5254: fanquake: tACK https://github.com/bitcoin/bitcoin/pull/16124/commits/3c5254a820c892b448dfb42991f6109a032a3730 Empact: utACK https://github.com/bitcoin/bitcoin/commit/3c5254a820c892b448dfb42991f6109a032a3730 Tree-SHA512: 68733494a5f2a7764eba938af227145f5ef9ddc9ff94840134e4d2684ca7b9a819fac491ec43102f93e5e9867373bfd46b46efc9d11528329b5ecb2282fffb16
Diffstat (limited to 'test')
-rwxr-xr-xtest/lint/lint-python.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/lint/lint-python.sh b/test/lint/lint-python.sh
index f5b851aeab..a76806003f 100755
--- a/test/lint/lint-python.sh
+++ b/test/lint/lint-python.sh
@@ -90,4 +90,10 @@ elif PYTHONWARNINGS="ignore" flake8 --version | grep -q "Python 2"; then
exit 0
fi
-PYTHONWARNINGS="ignore" flake8 --ignore=B,C,E,F,I,N,W --select=$(IFS=","; echo "${enabled[*]}") "${@:-.}"
+PYTHONWARNINGS="ignore" flake8 --ignore=B,C,E,F,I,N,W --select=$(IFS=","; echo "${enabled[*]}") $(
+ if [[ $# == 0 ]]; then
+ git ls-files "*.py"
+ else
+ echo "$@"
+ fi
+)