8000 [MRG] move flake8 options from flake8_diff.sh to setup.cfg (#10080) · maskani-moh/scikit-learn@4df9e26 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4df9e26

Browse files
siftikhamaskani-moh
authored andcommitted
[MRG] move flake8 options from flake8_diff.sh to setup.cfg (scikit-learn#10080)
Also add examples/.flake8 for examples specific flake8 configuration
1 parent 2cafde9 commit 4df9e26

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

build_tools/travis/flake8_diff.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,9 @@ check_files() {
137137
if [[ "$MODIFIED_FILES" == "no_match" ]]; then
138138
echo "No file outside sklearn/externals and doc/sphinxext/sphinx_gallery has been modified"
139139
else
140-
# Default ignore PEP8 violations are from flake8 3.3.0
141-
DEFAULT_IGNORED_PEP8=E121,E123,E126,E226,E24,E704,W503,W504
142-
check_files "$(echo "$MODIFIED_FILES" | grep -v ^examples)" \
143-
--ignore $DEFAULT_IGNORED_PEP8
144-
# Examples are allowed to not have imports at top of file
140+
141+
check_files "$(echo "$MODIFIED_FILES" | grep -v ^examples)"
145142
check_files "$(echo "$MODIFIED_FILES" | grep ^examples)" \
146-
--ignore $DEFAULT_IGNORED_PEP8 --ignore E402
143+
--config ./examples/.flake8
147144
fi
148145
echo -e "No problem detected by flake8\n"

examples/.flake8

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Examples specific flake8 configuration
2+
3+
[flake8]
4+
# Same ignore as project-wide plus E402 (imports not at top of file)
5+
ignore=E121,E123,E126,E24,E226,E704,W503,W504,E402

setup.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ artifact_indexes=
3838
# https://ci.appveyor.com/project/sklearn-ci/scikit-learn/
3939
http://windows-wheels.scikit-learn.org/
4040

41+
[flake8]
42+
# Default flake8 3.5 ignored flags
43+
ignore=E121,E123,E126,E226,E24,E704,W503,W504
44+
4145
# Uncomment the following under windows to build using:
4246
# http://sourceforge.net/projects/mingw/
4347

0 commit comments

Comments
 (0)
0