Skip to content

Commit 3c5254a

Browse files
Limit Python linting to files in the repo
1 parent c7cfd20 commit 3c5254a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/lint/lint-python.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,10 @@ elif PYTHONWARNINGS="ignore" flake8 --version | grep -q "Python 2"; then
9090
exit 0
9191
fi
9292

93-
PYTHONWARNINGS="ignore" flake8 --ignore=B,C,E,F,I,N,W --select=$(IFS=","; echo "${enabled[*]}") "${@:-.}"
93+
PYTHONWARNINGS="ignore" flake8 --ignore=B,C,E,F,I,N,W --select=$(IFS=","; echo "${enabled[*]}") $(
94+
if [[ $# == 0 ]]; then
95+
git ls-files "*.py"
96+
else
97+
echo "$@"
98+
fi
99+
)

0 commit comments

Comments
 (0)