Skip to content

Commit 46c82ae

Browse files
RoyLinRoyLin
authored andcommitted
docs: add pre-commit hook setup instructions
1 parent bfce42e commit 46c82ae

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1116,10 +1116,22 @@ cargo test --lib # Unit tests only
11161116

11171117
- Follow Rust API guidelines
11181118
- Write tests for all new code
1119-
- Use `cargo fmt` and `cargo clippy`
1119+
- **Run `cargo fmt --all` before committing** (enforced by pre-commit hook)
1120+
- Use `cargo clippy` to check for lints
11201121
- Update documentation
11211122
- Use [Conventional Commits](https://www.conventionalcommits.org/)
11221123

1124+
### Setup Pre-commit Hook
1125+
1126+
Install the pre-commit hook to automatically check formatting:
1127+
1128+
```bash
1129+
cp scripts/pre-commit .git/hooks/pre-commit
1130+
chmod +x .git/hooks/pre-commit
1131+
```
1132+
1133+
This will prevent commits with unformatted code and ensure CI checks pass.
1134+
11231135
---
11241136

11251137
## Community

0 commit comments

Comments
 (0)