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

Skip to content

Too strict settings for flake8 in TravisCI build #9121

Closed
@rth

Description

@rth

Description

The flake8 Travis CI build currently runs flake8 --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.

What do you think @lesteve ?

Steps/Code to Reproduce

flake8_example.py

x, y = 2, 3
x = x*2 - 1
hypot2 = x*x + y*y
  1. Run flake8 flake8_example.py => everything looks OK.
  2. Make a PR with this code to scikit-learn. Wait 20min. See the Travis CI flake8 build fail (e.g. in [MRG+1] Add text vectorizers benchmarks #9086).
  3. Rerun flake8 on your machine => still looks OK. Install the same version of flake8 => still no errors
  4. Start reading through scikit-learn/build_tools/travis/flake8_diff.sh
  5. Wonder why it fails, read through related flake8 issues

Expected Results

No errors, since this is valid PEP8 code taken from https://www.python.org/dev/peps/pep-0008/#other-recommendations.

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.

Actual Results

Some lost contributors time.

Versions

master scikit-learn branch, flake8 3.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions