Skip to content
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

pre-commit hook should only run on pre-commit stage #4381

Closed
wants to merge 2 commits into from

Conversation

rdbisme
Copy link

@rdbisme rdbisme commented Oct 30, 2024

No description provided.

@ssbarnea
Copy link
Member

ssbarnea commented Nov 2, 2024

Can you please provide more information about this? When a hook runs is more to the user, some might decide to run them on pre-commit, some might decide to run them on push.

@rdbisme
Copy link
Author

rdbisme commented Nov 2, 2024

Just that by default this gets called n times, where n is the stages. In my case I had installed the pre-commit stage and the commit-msg, it got called twice. I guess someone wants to run it mostly once. So setting a default stage would prevent double call (as in general happens with other hooks).

People can always override this.

@ssbarnea
Copy link
Member

ssbarnea commented Nov 2, 2024

I am not aware of other linter using custom stages. Based on https://pre-commit.com/#confining-hooks-to-run-at-certain-stages I think is the best not to mention these and allow the user to decide which one he wants to use. Default values seems reasonable.

@ssbarnea ssbarnea closed this Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants