-
Notifications
You must be signed in to change notification settings - Fork 8.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
[discuss] Changes to pre-commit hook #81504
Comments
Pinging @elastic/kibana-operations (Team:Operations) |
I am not in the 👍 camp but I'm also not against it because I don't know if the proposal will introduce any new friction for me. I already run |
Is there any way that a shell environment variable could be used to flag bootstrap to automatically register the git hook? I like the pattern that the |
@tsullivan Maybe you want to use an alias instead of calling bootstrap directly, I plan to change my
|
@mistic and I have also discussed ensuring that the equivelant of the pre-commit hook is run early on CI and the error message to include information on registering the pre-commit hook. Another thought on allowing the pre-commit hook to be more owned by the developer and not overwritten is that it would allow them to also add things like running Jest with |
For those reading along, you can add a precommit file that will be executed by the Kibana-installed precommit hook: #39784. It doesn't allow you to override the Kibana-installed precommit hook but figure it might be useful for some cases. |
We are currently enforcing the pre-commit hook by writing to
.git/hooks/pre-commit
as part of bootstrap. The pre-commit hook aims to identify issues for the staged files to reduce the feedback loop from CI.As part of the new build tooling, we have identified some friction using our current method, and I would like to understand if contributors would prefer the proposed change. Additionally, while the pre-commit hook is useful, often you would like to bypass it. That can be done with
--no-verify
; however, that is not always the case as with an interactive rebase.On CI, we could identify if the pre-commit hook would have prevented a failure and recommend using it.
Proposal:
The pre-commit hook would no longer be forcefully installed on bootstrap. You can manually run the pre-commit hook with
node scripts/precommit_hook,
or you can have it installed for you withnode scripts/register_git_hook.
Issues with the current approach:
Please:
👍 if you are in favor
👎 if you are against
Comment if you have feedback
The text was updated successfully, but these errors were encountered: