You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Too strict settings for flake8 in TravisCI build #9121
The flake8 Travis CI build currently runsflake8 --ignore=W503 <files> on modified (non example) files. This is much stricter than the defaults which are--ignore=E121,E123,E126,E226,E24,E704,W503,W504 in the latest flake8 verison. This leads to an inefficient contribution workflow (and sometimes non PEP8 compatible style). Also related to @GaelVaroquaux observations about it during the last sprint.
I understand that less strict settings, might mean potentially more comments during PR reviews. At least; when Travis CI fails due to flake8 it should print the settings of flake8 that were used.
Ah. I think that ignore was intended to *add* to the defaults, perhaps at a
time when (or on a system where) that wasn't a default. Happy to remove
the --ignore flag.
Looks like an oversight more than anything else and I would be happy to review PRs to make the experience more pleasant for everyone involved.
A few comments:
flake8 2.5.1 is used on the CI because flake 3.3.0 checks non python files in the diff. I seem to remember there was an issue about this but I didn't check recently.
you should run bash build_tools/travis/flake8_diff.sh locally (you need to commit first) if you want to run the same command as on Travis (care was taken to make sure that the command could be run locally as well on Travis). Using flake8 2.5.1 is required here too.
😠 this is a bit confusing, I think I should fix that ...
I don't think there is an easy fix actually without adding too much complexity so I am going to leave it like this and promise to look at this in case a similar problem happens again.
Activity
jnothman commentedon Jun 14, 2017
lesteve commentedon Jun 14, 2017
Looks like an oversight more than anything else and I would be happy to review PRs to make the experience more pleasant for everyone involved.
A few comments:
bash build_tools/travis/flake8_diff.shlocally (you need to commit first) if you want to run the same command as on Travis (care was taken to make sure that the command could be run locally as well on Travis). Using flake8 2.5.1 is required here too.lesteve commentedon Jun 14, 2017
I think we want to add the default i.e.
--ignore=E121,E123,E126,E226,E24,E704,W503,W504instead.and probably do something similar for the examples.
BTW out of curiosity, do you have an example of a failing build?
lesteve commentedon Jun 14, 2017
OK I missed it from your original post, sorry. On #9086 it does not fail locally, no idea why it fails on Travis ...
rth commentedon Jun 14, 2017
Thanks for your reponse @jnothman and @lesteve ! Makes sens, flake8 defaults might have also changed in the last few years.
Sure,
could you just please double check that those are indeed the default? Read it in the flask8 docs, but didn't check the code...Thanks )Yes that was https://travis-ci.org/scikit-learn/scikit-learn/jobs/241700810 , not sure either..
Made a PR following your suggestions in #9123
lesteve commentedon Jun 14, 2017
I think that's the problem is that:
flake8_diff.shfrom master which has the--ignore W503argumentflake8_diff.shfrom the PR branch which does not have the--ignore W503argument and as such ignore the default stuff.😠 this is a bit confusing, I think I should fix that ...
lesteve commentedon Jun 14, 2017
I don't think there is an easy fix actually without adding too much complexity so I am going to leave it like this and promise to look at this in case a similar problem happens again.