feat: Add Git hooks for pre-commit and pre-push testing #79
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a standardized .githooks/ directory and sets Git’s core.hooksPath so that all contributors automatically run the test suite before committing or pushing code.
This ensures higher code quality, fewer regressions, and more reliable collaboration across the team.
Why Git commit hooks are important
Git hooks provide an automated safety net that prevents bad code from entering the repository.
They catch issues early, before code is pushed upstream or reviewed.
Specifically, commit hooks:
Prevent broken code from being committed. Developers may forget to manually run the test suite. Automated pre-commit execution guarantees no commit lands with failing tests.
Reduce CI load and pipeline failures. If test failures are caught locally, CI doesn’t need to waste cycles on preventable errors.
Improve consistency across the team. Every contributor follows the same workflow — no more “it works on my machine but fails on CI” situations.