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

Commit dfba1f7

Browse files
sanity-check.sh: disable some spurious warnings (#126)
* 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).
1 parent 9ecf51a commit dfba1f7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ci/sanity-check/sanity-check.sh

+8-2
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,17 @@ printf "Running black on python files...\n"
118118
printf "%s" "$PYTHON_FILES" | xargs --no-run-if-empty black --line-length 79 -v --check --diff || rc=1
119119

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

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

128134
exit "$rc"

0 commit comments

Comments
 (0)