TRAVIS fix flake8_diff.sh check_files
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.
@@ -125,10 +125,13 @@ MODIFIED_FILES="$(git diff --name-only $COMMIT_RANGE | grep -v 'sklearn/external
check_files() {
files="$1"
- options="$2"
+ 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
