Skip to content

Commit

Permalink
[MRG] move flake8 options from flake8_diff.sh to setup.cfg (scikit-le…
Browse files Browse the repository at this point in the history
…arn#10080)

Also add examples/.flake8 for examples specific flake8 configuration
  • Loading branch information
siftikha authored and lesteve committed Nov 14, 2017
1 parent b272358 commit 62eda82
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
9 changes: 3 additions & 6 deletions build_tools/travis/flake8_diff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,9 @@ check_files() {
if [[ "$MODIFIED_FILES" == "no_match" ]]; then
echo "No file outside sklearn/externals and doc/sphinxext/sphinx_gallery has been modified"
else
# 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 $DEFAULT_IGNORED_PEP8
# Examples are allowed to not have imports at top of file

check_files "$(echo "$MODIFIED_FILES" | grep -v ^examples)"
check_files "$(echo "$MODIFIED_FILES" | grep ^examples)" \
--ignore $DEFAULT_IGNORED_PEP8 --ignore E402
--config ./examples/.flake8
fi
echo -e "No problem detected by flake8\n"
5 changes: 5 additions & 0 deletions examples/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Examples specific flake8 configuration

[flake8]
# Same ignore as project-wide plus E402 (imports not at top of file)
ignore=E121,E123,E126,E24,E226,E704,W503,W504,E402
4 changes: 4 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ artifact_indexes=
# https://ci.appveyor.com/project/sklearn-ci/scikit-learn/
http:https://windows-wheels.scikit-learn.org/

[flake8]
# Default flake8 3.5 ignored flags
ignore=E121,E123,E126,E226,E24,E704,W503,W504

# Uncomment the following under windows to build using:
# http:https://sourceforge.net/projects/mingw/

Expand Down

0 comments on commit 62eda82

Please sign in to comment.