Skip to content

Commit

Permalink
Merge bitcoin#16124: tests: Limit Python linting to files in the repo
Browse files Browse the repository at this point in the history
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
  • Loading branch information
laanwj committed Jun 3, 2019
2 parents 6520330 + 3c5254a commit d3a1c25
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/lint/lint-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

0 comments on commit d3a1c25

Please sign in to comment.