From 3c5254a820c892b448dfb42991f6109a032a3730 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Thu, 30 May 2019 08:33:08 +0200 Subject: [PATCH] Limit Python linting to files in the repo --- test/lint/lint-python.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/lint/lint-python.sh b/test/lint/lint-python.sh index f5b851aeabc6e..a76806003f1ca 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 +)