Merge #16124: tests: Limit Python linting to files in the repo

3c5254a820 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 3c5254a820
  Empact:
    utACK 3c5254a820

Tree-SHA512: 68733494a5f2a7764eba938af227145f5ef9ddc9ff94840134e4d2684ca7b9a819fac491ec43102f93e5e9867373bfd46b46efc9d11528329b5ecb2282fffb16
pull/16143/head
Wladimir J. van der Laan 6 years ago
commit d3a1c2502b
No known key found for this signature in database
GPG Key ID: 1E4AED62986CD25D

@ -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
)

Loading…
Cancel
Save