Skip to content
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

flake8 upgrade has broken CI #4520

Closed
reaperhulk opened this issue Oct 24, 2018 · 4 comments
Closed

flake8 upgrade has broken CI #4520

reaperhulk opened this issue Oct 24, 2018 · 4 comments

Comments

@reaperhulk
Copy link
Member

New flake8 adds a W504 error which prohibits line breaks after binary operators. (See: https://travis-ci.org/pyca/cryptography/jobs/445519395)

We can fix this by ignoring W504, conforming to the new flake8 desire, or blackening the entire codebase and switching to black --check for our linting job. The final option would involve one very large PR transforming the whole existing codebase.

I'm in favor of switching to black as maximally opinionated code formatters are clearly the best. What do you think @alex?

@reaperhulk
Copy link
Member Author

We'd probably still need to run flake8 to check for things like unused variables unfortunately, but maybe we can just opt into a single check?

@alex
Copy link
Member

alex commented Oct 24, 2018

If we want to use black, we can probably just use the F and N families from flake8.

@reaperhulk reaperhulk changed the title flake8 upgrades has broken CI flake8 upgrade has broken CI Oct 24, 2018
@reaperhulk
Copy link
Member Author

The PR to fix this has set josepy to an allowed failure since they're having flake8 errors at the moment (and certbot/josepy#39 doesn't fix it for unknown reasons). We should revert that as soon as the downstream is green again.

@reaperhulk
Copy link
Member Author

I've convinced myself that this isn't a good path right now. To migrate we'd need to:

  • Blacken codebase
  • Devs need to use flake8 (with flake8-import-order and unused variable checks enabled) + black on save (possibly with a custom line length)
  • CI would run black --check and also flake8 with the above checks and fail if you didn't do it.

Running black on every save in your editor, however, is a bad idea since most projects don't use black. So you'd need to either remember to run black manually before commit or write something such that you could have black on save auto-enabled for specific projects. This exceeds my threshold for caring at the moment so status quo it is.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants