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

Skip to content

TST: make E402 a universal flake8 ignore #11621

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

Closed
wants to merge 1 commit into from

Conversation

jklymak
Copy link
Member

@jklymak jklymak commented Jul 10, 2018

PR Summary

#11613 made flake8 exceptions explicit, but the whole examples directory was ignoring E402 before via a glob.

This PR makes E402 ignored everywhere...

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@jklymak jklymak mentioned this pull request Jul 10, 2018
1 task
@jklymak jklymak requested a review from QuLogic July 10, 2018 20:35
@tacaswell tacaswell added this to the v3.0 milestone Jul 10, 2018
@QuLogic
Copy link
Member

QuLogic commented Jul 10, 2018

As noted in #11613 (comment), I'd prefer if we leave these and # noqa any new References sections. And ideally, sphinx-gallery would do it all for us.

@jklymak
Copy link
Member Author

jklymak commented Jul 10, 2018

Note sphinx-gallery/sphinx-gallery#205
sphinx-gallery/sphinx-gallery#347

Looks like sphinx gallery will merge the ability to add :meth:our-buried-method to the backreferences!

@ImportanceOfBeingErnest
Copy link
Member

Just a more general view here: I think examples are meant to teach how to acomplish something with the library at hand. They do not need to be PEP8 compatible. Of course one should not teach bad style, but the reason for E402 does not really apply to any examples anyways. For the sake of understandability, it might make perfect sense to import certrain things late in an example or a tutorial, close to the place where it is actually needed, such that the reader does not need to scroll all the way up to a place where all imports live.

@jklymak jklymak mentioned this pull request Jul 13, 2018
1 task
@tacaswell
Copy link
Member

Is there a way to over-lapping constraints like that?

I like @ImportanceOfBeingErnest 's suggestion that we only skip this test on the examples.

@jklymak
Copy link
Member Author

jklymak commented Jul 15, 2018

Thats how it was before #11613, but @QuLogic doesn't like the globs....

@jklymak
Copy link
Member Author

jklymak commented Jul 15, 2018

BTW< I don't care about this PR at all - please set up flake8 the way you'd like it. I just use it from the command line so however experts want it set up is fine w/ me...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants