Conversation
There was a problem hiding this comment.
Pull request overview
Adds Rust-focused pre-commit hooks to the repository’s existing pre-commit setup, aligning Rust development workflow with the formatting/linting checks already present for other languages.
Changes:
- Added a local
cargo fmtpre-commit hook to enforce consistent Rust formatting. - Added a local
cargo clippyhook configured to run only in themanualstage.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| name: Rust cargo fmt | ||
| entry: bash -c 'cd rust && cargo fmt --all' | ||
| language: system | ||
| files: ^rust/.*\.(rs|toml|lock)$ |
There was a problem hiding this comment.
The cargo-fmt hook is configured to run on .toml and .lock changes, but cargo fmt only formats Rust source files. Consider narrowing the files regex to ^rust/.*\.rs$ (or switching to types: [rust]) to avoid unnecessary hook runs on non-Rust files.
| files: ^rust/.*\.(rs|toml|lock)$ | |
| files: ^rust/.*\.rs$ |
|
@quan319 |
Reason for this PR
This PR addresses the request to add missing Rust pre-commit hooks to the repository. The project already includes pre-commit checks for other languages, but Rust tooling was not yet covered. Adding these hooks helps keep Rust code formatted consistently and improves development workflow.
This work is related to issue #753.
What changes are included in this PR?
Added a Rust cargo fmt pre-commit hook for consistent formatting
Added a Rust cargo clippy hook which I configured as manual to surface lint warnings without blocking commits
Are these changes tested?
Yes the changes were tested. The cargo fmt hook was run locally to verify formatting behavior.
The cargo clippy hook was verified to run correctly and is configured as a manual hook due to platform-specific build dependencies.
Are there any user-facing changes?
No. These changes only affect development tooling and do not impact end users or public APIs.