-
Notifications
You must be signed in to change notification settings - Fork 101
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
Run flake8 via pre-commit #891
Conversation
e.g. `tox -e pre-commit` modified: .pre-commit-config.yaml modified: tox.ini
... as only `isort` is currently left. modified: tox.ini
modified: .travis.yml
modified: .pre-commit-config.yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but I additionally I'd expect a bit of documentation. I thought we already have a bit of developer documentation but I did not find it in the repository.
Thanks for your feedback, @icemac About the documentation - back when Lines 101 to 108 in 0402402
And yes, this page https://www.zope.org/developer/index.html needs an update. Let's make an issue for Monday's sprint? I just had another look at my pr, and there is one problem with it. As I suggest to add I hope this is both ok for you and for Jens: |
I strongly dislike this. When we talked about pre-commit first in conjunction with pyupgrade we only put pyupgrade into pre-commit and left it out of tox so that something inconsequential will not make tox fail. Now you're moving flake8 in there as well which then requires running pre-commit on Travis so we get the flake8 warnings again. I would much prefer to keep the current tox setup and leave flake8 in there. |
Correction: We left pre-commit out of Travis so Travis won't fail on unimportant stuff. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's a summary of my concerns:
You claim "flake8 can and probably should be run via pre-commit" without giving any valid arguments why. You also quote #826, but IMHO that was an unusual and rare situation. We have not seen it before, and we have not seen it again since. As I see it those are weak arguments in relation to the problems this patch will cause:
- In order to still see flake8 failures in Travis you now must run
pre-commit
in Travis, which will also runpyupgrade
. Addpyupgrade
to linter setup #859 led to the introduction ofpyupgrade
and I argued that forcingpyupgrade
runs on Travis will just add another barrier for contributors for no gain - both Jürgen and I agreed that we really don't care if people submit code that doesn't passpyupgrade
- you're also breaking the convention of running the linter and having linter configuration right inside
tox.ini
, and we use that convention in every single package in this organization that I am aware of. This is adding confusion.
In summary, I see no advantage here, just disadvantages. Please do not merge this.
No worries - I know this would be a major change, so I wanted to wait for the feedback of both of you. The intention of this pr was...
You certainly know that you can add I proposed to use When we had the discussion about integrating And so we've come full circle. I do not think this pr is missing a documentation, but this project itself is missing an updated contributing documentation, ie https://www.zope.org/developer/index.html - and this is nothing an occasional contributor could do, but the core maintainers should do, in order to reflect your expecations. Using Afaik, it is not possible to give different linters different weights with |
That's an... interesting goal. Please don't forget that similar to
I had sent a correction, what I meant was we left it out of Travis so Travis won't fail on something that's just not important.
Not sure what you're referring to. We have well-working configurations for linters etc. and I am not aware that there's an issue with files getting overlooked.
The difference between
IMHO such a documentation effort would be a much better use of time than this PR. Or a much better use of time than e.g. upgrading
There's a whole other discussion to be had about |
As this issue has not been closed yet... Django just announced they will use Flask also uses Cherrypy uses Morepath uses |
I personally wouldn't consider "someone else is using it" a compelling argument. |
I added this PR to the sprint agenda of next Friday - either close it for good, or revive the discussion. |
Decided to close during a meeting of the Zope April Sprint 2021. |
Similar to
pyupgrade
, also flake8 can and probably should be run viapre-commit
.e.g.
tox -e pre-commit
This also fixes #826
This solution seems to be preferable over pinning versions in a requirements file, as here it is easier to update the dependencies - just run:
pre-commit autoupdate