Skip to content

Commit

Permalink
TRAVIS fix flake8_diff.sh check_files (scikit-learn#8208)
Browse files Browse the repository at this point in the history
when $files is empty.

A sphinx-gallery updated introduced flake8 violations which were not
ignored because $files was empty so all the files were checked instead
of only the examples.
  • Loading branch information
lesteve authored Jan 16, 2017
1 parent eabaef3 commit 0eb33ad
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions build_tools/travis/flake8_diff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,13 @@ MODIFIED_FILES="$(git diff --name-only $COMMIT_RANGE | grep -v 'sklearn/external

check_files() {
files="$1"
options="$2"
# Conservative approach: diff without context (--unified=0) so that code
# that was not changed does not create failures
git diff --unified=0 $COMMIT_RANGE -- $files | flake8 --diff --show-source $options
shift
options="$*"
if [ -n "$files" ]; then
# Conservative approach: diff without context (--unified=0) so that code
# that was not changed does not create failures
git diff --unified=0 $COMMIT_RANGE -- $files | flake8 --diff --show-source $options
fi
}

if [[ "$MODIFIED_FILES" == "no_match" ]]; then
Expand Down

0 comments on commit 0eb33ad

Please sign in to comment.