Run pre-commit hook before the prompt
See original GitHub issueI use pre-commit hooks to format my code and check with npm audit
for insecure modules. There are times I run through the whole commit prompt only to have my pre-commit hook(s) fail and have to redo my commit message.
I think it would be great if the cli ran pre-commit hooks before the prompt much like it checks that some files have been added to staging.
I’m happy to work on a PR, just curious what the community thinks.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:30
- Comments:20 (2 by maintainers)
Top Results From Across the Web
pre-commit
Git hook scripts are useful for identifying simple issues before submission to code review. We run our hooks on every commit to automatically...
Read more >Trusting a Git pre-commit hook to Run Checks Automatically
The pre-commit hook gets called first before any memory is used for the commit object. The prepare-commit-msg hook gets called when Git checks ......
Read more >git prompting me before commit - Stack Overflow
The pre-commit hook is run first, before you even type in a commit message. It's used to inspect the snapshot that's about to...
Read more >Pre-Commit Hook Example in GitKraken Client | Git Hooks ...
First navigate to the hooks directory for the target repo. Open a Visual Studio Code window and navigate to repo .git hooks. From...
Read more >How to use git pre-commit hooks, the hard way and the easy ...
The hook runs before a commit is accepted to git, and if the hook script fails (ie if it returns a non-zero exit...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@dkimot @LinusU I still think we should not allow the cli to run if pre-commit hook fails. what do you guys think ?
We shouldn’t allow the the cli to run if pre-commit hook fails and also if files are not added. Did everyone agree on this ? Is anyone working on this ? Or Can I take this up ?