Skip to content
This repository has been archived by the owner on Apr 22, 2020. It is now read-only.

Commit

Permalink
sanity-check.sh: disable some spurious warnings (#126)
Browse files Browse the repository at this point in the history
* The default behaviour of pydocstyle is to ignore "test_" files when
  given a directory to check. Follow its example and ignore "test_"
  files in the invocation we use too.

* Ignore pycodestyle "E203" warnings - sometimes they are spurious
  (PyCQA/pycodestyle#373).
  • Loading branch information
jonathanhaigh-arm authored Jan 29, 2019
1 parent 9ecf51a commit dfba1f7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ci/sanity-check/sanity-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,17 @@ printf "Running black on python files...\n"
printf "%s" "$PYTHON_FILES" | xargs --no-run-if-empty black --line-length 79 -v --check --diff || rc=1

# Run pycodestyle on python files
# Ignore E203 errors though - they can be spurious
# (https://github.com/PyCQA/pycodestyle/issues/373)
printf "Running pycodestyle on python files...\n"
printf "%s" "$PYTHON_FILES" | xargs --no-run-if-empty pycodestyle || rc=1
printf "%s" "$PYTHON_FILES" | xargs --no-run-if-empty pycodestyle --ignore=E203 || rc=1

# Run pydocstyle on python files
# When pydocstyle is given a directory to check it will, by default, skip
# "test_" files. We're passing pydocstyle full paths to each file though, and
# the directory part of the paths prevent "test_" files matching pydocstyle's
# filter. Adjust it here so that "test_" files are actually skipped.
printf "Running pydocstyle on python files...\n"
printf "%s" "$PYTHON_FILES" | xargs --no-run-if-empty pydocstyle || rc=1
printf "%s" "$PYTHON_FILES" | xargs --no-run-if-empty pydocstyle --match='(?!.*test_).*\.py' || rc=1

exit "$rc"

0 comments on commit dfba1f7

Please sign in to comment.