Open
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.
Suggested change
| files: ^rust/.*\.(rs|toml|lock)$ | |
| files: ^rust/.*\.rs$ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.