Skip to content

ci(githooks): add pre-commit and pre-push hooks#384

Open
hajiboy95 wants to merge 1 commit into
acsandmann:mainfrom
hajiboy95:add-githooks
Open

ci(githooks): add pre-commit and pre-push hooks#384
hajiboy95 wants to merge 1 commit into
acsandmann:mainfrom
hajiboy95:add-githooks

Conversation

@hajiboy95

Copy link
Copy Markdown
Contributor

Summary

This PR adds local git hooks inside the .githooks/ directory to help developers maintain strict code formatting and run tests automatically before committing or pushing changes.

Key Changes

  • .githooks/pre-commit: Automatically formats the codebase using the nightly toolchain (cargo +nightly fmt --all) and stages the formatted changes.
  • .githooks/pre-push: Automatically runs cargo test prior to a push and prevents the push if any tests fail.
  • Executable Permissions: Preserves chmod +x file permissions for both hook scripts in the repository.

Developer Setup

Once this is merged, developers can enable these local hooks in their client by running:

git config core.hooksPath .githooks

@hajiboy95

Copy link
Copy Markdown
Contributor Author

@acsandmann are you against hook in your Repo? If you don't want them I can close this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant