From 0c57a6732df413589e209d319ee8755de8d17802 Mon Sep 17 00:00:00 2001 From: Roman Yurchak Date: Wed, 14 Jun 2017 13:38:10 +0100 Subject: [PATCH 1/2] Using the default flake8 versions --- build_tools/travis/flake8_diff.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build_tools/travis/flake8_diff.sh b/build_tools/travis/flake8_diff.sh index f33821481170e..1ee9e2ac92fd6 100755 --- a/build_tools/travis/flake8_diff.sh +++ b/build_tools/travis/flake8_diff.sh @@ -137,8 +137,11 @@ check_files() { if [[ "$MODIFIED_FILES" == "no_match" ]]; then echo "No file outside sklearn/externals and doc/sphinxext/sphinx_gallery has been modified" else - check_files "$(echo "$MODIFIED_FILES" | grep -v ^examples)" --ignore=W503 + # Running flake8 with the default --ignore options + check_files "$(echo "$MODIFIED_FILES" | grep -v ^examples)" \ + --ignore=E121,E123,E126,E226,E24,E704,W503,W504 # Examples are allowed to not have imports at top of file - check_files "$(echo "$MODIFIED_FILES" | grep ^examples)" --ignore=E402,W503 + check_files "$(echo "$MODIFIED_FILES" | grep ^examples)" \ + --ignore=E402,E121,E123,E126,E226,E24,E704,W503,W504 fi echo -e "No problem detected by flake8\n" From 1a8fee9ebf2ee20dd2be72633ef964b3d265466c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Est=C3=A8ve?= Date: Wed, 14 Jun 2017 15:01:41 +0200 Subject: [PATCH 2/2] Small tweak --- build_tools/travis/flake8_diff.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build_tools/travis/flake8_diff.sh b/build_tools/travis/flake8_diff.sh index 1ee9e2ac92fd6..84495b339a922 100755 --- a/build_tools/travis/flake8_diff.sh +++ b/build_tools/travis/flake8_diff.sh @@ -137,11 +137,12 @@ check_files() { if [[ "$MODIFIED_FILES" == "no_match" ]]; then echo "No file outside sklearn/externals and doc/sphinxext/sphinx_gallery has been modified" else - # Running flake8 with the default --ignore options + # Default ignore PEP8 violations are from flake8 3.3.0 + DEFAULT_IGNORED_PEP8=E121,E123,E126,E226,E24,E704,W503,W504 check_files "$(echo "$MODIFIED_FILES" | grep -v ^examples)" \ - --ignore=E121,E123,E126,E226,E24,E704,W503,W504 + --ignore $DEFAULT_IGNORED_PEP8 # Examples are allowed to not have imports at top of file check_files "$(echo "$MODIFIED_FILES" | grep ^examples)" \ - --ignore=E402,E121,E123,E126,E226,E24,E704,W503,W504 + --ignore $DEFAULT_IGNORED_PEP8 --ignore E402 fi echo -e "No problem detected by flake8\n"