Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[MRG] move flake8 options from shell script to setup.cfg fixes #10067 #10080

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Nov 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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://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://sourceforge.net/projects/mingw/

Expand Down