-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Fix bad developer experience due to Husky pre-commit hooks #20246
Comments
🤔 prettier shouldn't complain, it should normally just fix the issue. developers should also use a good idea, which shows lint Errors while you type. like free vscode. for a maintainer it's more work to review and request changes because of failed prettier. |
Some more background information. We tried fixing bad stuff on the contributors' PR branches automatically, for more context read the issue and PR: Summary: we rejected the PR to auto-fix stuff. This is because of security concerns with using |
I prefer 2 or 3. The commit linting takes too long today. |
You were happy with my PR to "block accidental pushes to
Related PR: If you go with option 3 we also drop the check for commits/pushes to Footnotes |
Not pushing to |
I think the big thing is that we need to decide who to bother with the time loss:
|
I think unfortunately the linting is too slow right now. If it were maybe <5s, it might be manageable |
it's probably the markdown lint which always scans all files. 🤔 maybe it's eslint because of the circular dep check i added some time ago. |
GitHub can now block direct pushes when you have required workflows: 1
Does this mean that we can drop the part of the Husky script that blockes pushes to Footnotes |
I don't think that will stop users from committing to their own |
Oh yeah. Let's keep that check then. 🙂 |
See #22224 (comment)
|
🎉 This issue has been resolved in version 35.95.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Describe the proposed change(s).
Currently
Right now we use
husky
to run this script before eachgit commit
:The pre-commmit hook running the linters adds friction, for example:
This friction can stop people from becoming regular contributors, or just plain be annoying for the maintainers.
So here are some options to fix the problem, let's discuss! 😄
Option 1: drop
yarn lint-staged
andyarn ls-lint
commandsMaybe we want to drop the
yarn lint-staged
andyarn ls-lint
commands, and let our CI tests on the PR branch catch those errors. We keep the check to prevent wrong pushes tomain
.Option 2: use pre-push commit instead
We keep the current script, but change when it runs. When you run the script before
git push
you can commit "badly" as often as you want. But when it's time to push you need to clean up your work before pushing it to the PR branch.If we do this option, we should change the log message for the script so it uses "pushes to main" instead of "committing to main". 😉
Option 3: drop husky fully
I don't think this is a good idea, most every commit should land into
main
via a PR, so that all the tests are run first. Only in rare cases do we want a maintainer to push tomain
directly.The text was updated successfully, but these errors were encountered: