-
Notifications
You must be signed in to change notification settings - Fork 22
Add automatic linting on git commit/push using hooks #104
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
Add automatic linting on git commit/push using hooks #104
Conversation
0a3e178
to
0beafd8
Compare
Is a rebase needed here, or is the PR going to be closed at some point (and not merged)? I'd happily rebase if it's something you'd like to have in master, and also happy to just close if it no one wants it ;) |
Thanks a lot for implementing these hooks! However, I have a few worries about them:
Do you think these worries can be addressed? ( |
Reading your comment, I feel this PR shouldn't be merged:
I'm closing this PR now, please reopen if you think the benefits outweigh the costs |
Thanks for the update! And thank you so much for working on this contribution in the first place 😄 linting has improved this project a lot.
That doesn't sound too bad, and guess it would be ok for a push hook (I still don't like anything in microseconds slowing down my commits, but maybe I'm a little extreme with this).
This sounds like an interesting compromise. It adds a lot of friction ("sorry, you can't push because of this problem I already know how to fix but didn't fix for you"), but it's a lot less surprising (e.g. I'd hate the hook to @nt1m @Coder206 and @bnjbvr, would you like Janitor to have a linting hook on The only issue I see with this is it makes it a bit less convenient to push work-in-progress changes to a repo (but maybe fixing code issues for these too is a good idea), and you'd have to know how to use the ignore list if you're importing third-party code. Other than that, I'd like to have a linting hook (only on |
Just a side note: you said you might have some files that are modified locally, but are not going to commit/push them (ever). In such cases, if those modified files have linting warning, you'll always have to commit/push by "forcing" (i mean by using the --no-verify flag) which might be a real pain. |
I agree with @jankeromnes about the WIP code part. These are changes you don't want to invest too much time in. |
I also agree with @jankeromnes's point of view for WIP code. I wonder if we could make it optional when pushing, say behind a flag. |
I don't mind the git push hook; generally I don't open WIP PRs, so the WIP issue wouldn't affect me. |
This commit was initially on #101, but was moved in a separate PR to be discussed.
The time overhead on a git commit or push is less than a second on my machine. IMHO this is negligeable compared to the benefits of never committing crap, catching obvious syntax mistakes and typos, and whitespace issues.