Skip to content

Commit

Permalink
ci: instruct how to set up git pre-commit hook (#372)
Browse files Browse the repository at this point in the history
**Commit Message**

that runs `make precommit`.

**Related Issues/PRs (if applicable)**

closes #368

Signed-off-by: David Xia <david@davidxia.com>
  • Loading branch information
davidxia authored Feb 19, 2025
1 parent 7c495e1 commit 5ead86a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ header:
- '.yamllint*'
- LICENSE
- CODEOWNERS
- pre-commit.sh
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 5ead86a

Please sign in to comment.