-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: Condense PR style checklist into one script #30773
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
Conversation
5b88c4e
to
d3efe65
Compare
I like the idea, but shouldn't we reuse |
Not quite a subset. As the
I'm not necessarily against combining in the future, but given the differences in what this script does vs. |
I see, I misunderstood that. Makes sense then. But may be the name |
I get your point. It's a hybrid though, as |
Not a big deal, but I think it's better to expect a script to change code, and that it possibly doesn't (even black and isort won't in many cases). Than have a script to check your code, that changes it unexpectedly. I don't even like that we need to use black and isort to change automatically our code. Having a script that does that in a somehow (unintentionally) sneaky way would be really annoying to me. |
True (though the How about |
Imagine a case where you didn't commit the changes, you run the checks to see if there is anything you missed, and then you realize that the checks made black actually destroyed all your styles. The surprise would still be there. ;) Anyway, In a follow up I may check if it's easy to display different messages depending on whether changes need to be committed or not, so users of the script don't need to read and think too much. |
@gfyoung are you using pre-commit? This script duplicates what it does. |
@TomAugspurger : I don't actually use it because the Unless we decide to make it a required thing on the PR checklist to use |
I'd vote for telling people to use pre-commit, and including whatever
checks we want in there.
…On Tue, Jan 7, 2020 at 2:32 PM gfyoung ***@***.***> wrote:
@TomAugspurger <https://github.com/TomAugspurger> : I don't actually
because the mypy check takes some time to run on my machine. You do raise
a good point that there is overlap due to the other checks.
Unless we decide to make it a required thing on the PR checklist to use
pre-commit, I think the script can allow us to be more comprehensive with
the checklist without having to enumerate all of the different checks we
run (even pre-commit is missing at least one: cpplint)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#30773?email_source=notifications&email_token=AAKAOIRIFCDE5O2G73OTOJTQ4TRERA5CNFSM4KDTQRW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIKFQEY#issuecomment-571758611>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKAOIRCXDKBJEOTLOK5FR3Q4TRERANCNFSM4KDTQRWQ>
.
|
cc @pandas-dev/pandas-core : Thoughts? The question is whether we want people to go in on using Alternatively, we condense the lint checkboxes into a single script as I have done here. The downside is that we still have some redundancy in maintaining linting checks. |
If we're concerned about the speed of the pre-commit hooks, we can discuss which items we want included by default. I don't have a strong opinion. Perhaps @xhochy can share his thoughts on he thought including mypy was a good idea. |
I would also strongly argue that people should just pre-commit instead of an additional script as it takes care of a lot of pitfalls one can run into. Normally I have all static checks in pre-commit add its an easy-to-setup way to ensure that people don't push code that will then fail on public CI but still consume resources there. I first also thought that mypy may be too slow but with a pre-filled cache, it is running really fast for me. Could be that it is only fast due my hardware and the cache is not fast enough for others, then it is probably better to remove mypy again until we get a better incremental mode for to work. People not using pre-commit because of this would be even worse. |
That would be a reasonable compromise. |
Anecdotally, I'm getting used to mypy running after a day or two, but it slightly annoyed me at first 😄. The initial check after changing branches can feel slow, but subsequent ones are much faster. So I'm happy either way. |
Sounds good. I'll open a new PR to move in this new direction then. |
d3efe65
to
a483da4
Compare
@gfyoung @TomAugspurger Can you give me a rough number how much time the mypy check with a pre-filled cache took for you? |
I have to say I have been quite annoyed the last days with the slowness of the commit hook now mypy was added. Is the caching normally working out of the box, or do I need to do something for that? But I have been switching a lot between branches, so that might a reason to be more annoyed. The mypy step in the pre-commit hook on a fresh branch takes around 20s for me. |
Also a second time on the same branch, it still takes a long time (around 20s), so even with caching, it is still annoyingly slow for committing IMO |
Removed it over at #30811 For me the timings are 18s without and 0.6s with a cache, so it seemed appropriate to me. I wasn't aware that the impact could be this big on different setups. |
Or my cache is not working properly for some reason? Although I see a |
In my case only |
Similar to what @jorisvandenbossche gave. |
Mine were closer to Uwe's.
…On Wed, Jan 8, 2020 at 3:43 AM gfyoung ***@***.***> wrote:
Can you give me a rough number how much time the mypy check with a
pre-filled cache took for you?
Similar to what @jorisvandenbossche
<https://github.com/jorisvandenbossche> gave
<#30773 (comment)>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#30773?email_source=notifications&email_token=AAKAOITEZSLRATO57W7U2W3Q4WN57A5CNFSM4KDTQRW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEILZEGI#issuecomment-571970073>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKAOIX6IYQD44J7VS3SXDDQ4WN57ANCNFSM4KDTQRWQ>
.
|
my mypy runtimes are closer to Joris's |
Closing this so we can focus on #30814 |
A script is easier to execute and manage as we manage our style-checking tools.
Started with
flake8
,black
, andisort
, as those are the main ones for Python-related changes (for reference, we didn't even haveisort
in the checklist beforehand).If we're happy with the structure, we can always add more OR modify checks if we want going forward while keeping it easy for folks to check their PR's.