Skip to content

Commit

Permalink
ci: instruct how to set up git pre-commit hook
Browse files Browse the repository at this point in the history
that runs `make precommit`.

closes #368

Signed-off-by: David Xia <david@davidxia.com>
  • Loading branch information
davidxia committed Feb 19, 2025
1 parent 5fe5e59 commit c8f8b8e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ For example, `make precommit test` will run the precommit checks and the unit te
These are the must-run commands before you submit or pushing commits to a PR.
If anything goes wrong, please try to run `make clean` and then run the command again.

You can make `make precommit` a git pre-commit hook by moving this file.

```shell
cp pre-commit.sh .git/hooks/pre-commit
```

All test targets are prefixed with `test-*` and can be run via `make test-<target>`.

Some test commands might require additional dependencies to be installed on your machine.
Expand Down
2 changes: 2 additions & 0 deletions pre-commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
make precommit

0 comments on commit c8f8b8e

Please sign in to comment.