Skip to content

Commit d3a1c25

Browse files
committed
Merge bitcoin#16124: tests: Limit Python linting to files in the repo
3c5254a 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 bitcoin@3c5254a Empact: utACK bitcoin@3c5254a Tree-SHA512: 68733494a5f2a7764eba938af227145f5ef9ddc9ff94840134e4d2684ca7b9a819fac491ec43102f93e5e9867373bfd46b46efc9d11528329b5ecb2282fffb16
2 parents 6520330 + 3c5254a commit d3a1c25

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)