-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
adapt Pre commit hook and black #3485
adapt Pre commit hook and black #3485
Conversation
Where/how is this config used? |
@blueyed by the pre-commit tool - its generalized pre commit hooks a dev can opt into |
Ah.. for reference: https://pre-commit.com/ |
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.
Looking good, but we also need to update CONTRIBUTING.rst
on how to install and use the hooks.
1514b7b
to
703e4b1
Compare
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.
I looked at the docs, thanks, looks good!
I tried your branch locally and would like to comment on a few points:
-
It seems
black
did not run on_testing
: when I runblack testing
I get changes in 24 files (see diff). -
We should add a
black --check
to thelinting
environment as well, people can forget to install pre-commit or even by pass the pre-commit checks withgit commit -n
. I was going to merge this PR and open another one containing this, but because of the first point I was left wondering if I'm losing something. -
I think we should squash all commits under a "Apply black formatting and pre-commit hooks" umbrella.
@nicoddemus this is consistent with the pinned black versions - else we get failing pre-commit on black upgradeds - i wil upgrade to the latest stable version however having black in the linting env creates a double failure point as its in need of version syncing i pan to set up a travis stage for the linting checks however |
dd4cb57
to
57a55cd
Compare
@nicoddemus after reiterating and going back to the older black version due to flake8 errors being introduced i reformatted a missing file and would like to get it merged including history for later comprehension |
Oh I see, different For linting we should use I think it is important to add the linting stage before merging to avoid getting commits that don't pass the checks, don't you agree? It should be simple to add a new travis stage for that. |
in that case we will have to defer and possibly rebase this one due to investigating sane caching for pre-commit on travis |
Why, do you think it will take a long time to install the pre-commit hooks? It takes less than a minute in my computer the first time, I don't think that's something to worry about. |
Nice! It seems to have worked wonderfully! Please update our After that I think we are in excellent shape, excellent work! |
i'd prefer to jsut drop the linting then - i'll take a look at getting ti to be pre-commit only as well @obestwalter it would be nice to have tox plugin for certain kinds of envs there |
You are right, dropping it is fine. If you do, please update CONTRIBUTING because we mention A small note: I just noticed that the |
@nicoddemus i just moved it to use pre-commit |
Thanks! Shouldn't the (Sorry for being so pedantic, just wanting to make sure we are not leaving loose ends). |
Hi @RonnyPfannschmidt, best might be to open a "plugin request issue" in tox repo (would be the first, I guess) explaining what you imagine. |
@nicoddemus i want the linting stage to be fast, whats missing now is a cache for pre-commit |
It went from Just saying I'm not particularly concerned with it, but if you really want to improve that timing then go for it. 👍 |
@nicoddemus i'd also like to put pypy into a own stage in some way |
Just so we keep track, I think the only thing missing is this:
Not sure why, but feel free to do this in another PR. |
@RonnyPfannschmidt gentle ping in case you didn't see my last comment. 👍 |
You might want to add the code style badge to the README also?
|
@nicoddemus i dont want to use tox for the linting since its an extra nesting i dont want to have |
OK, I fixed the two conflicts, if I have done everything correctly we should be able to merge it after all is green. |
Formatting the merged files and will push in a minute. |
🎉 |
prepare #3464