chore: update clippy to check only internal code, not deps#433
Conversation
WalkthroughUpdated the pre-commit clippy hook to lint the workspace's library and binary targets only, using Changes
Sequence Diagram(s)Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.pre-commit-config.yaml (1)
31-31: Confirm whether excluding tests is intentionalYou replaced “all targets” with
--lib --bins, which stops linting tests/examples/benches. If the intent was only “don’t lint external deps” while keeping internal test coverage, consider--all-targetsplus--no-deps:- entry: cargo clippy --workspace --lib --bins -- --no-deps -D warnings + entry: cargo clippy --workspace --all-targets -- --no-deps -D warnings
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
.pre-commit-config.yaml(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: boostsecurity - boostsecurityio/semgrep-pro
- GitHub Check: Redirect rules - openzeppelin-relayer
- GitHub Check: Header rules - openzeppelin-relayer
- GitHub Check: Pages changed - openzeppelin-relayer
- GitHub Check: Analyze (rust)
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
.pre-commit-config.yaml (2)
31-31: Optional: include unit tests (and examples) while still ignoring depsIf you want Clippy to also cover internal tests/examples without touching dependencies, add
--tests(and optionally--examples). This keeps the “no deps” guarantee but increases coverage of our own code.- entry: cargo clippy --workspace --lib --bins -- --no-deps -D warnings + entry: cargo clippy --workspace --lib --bins --tests --examples -- --no-deps -D warnings
31-31: Optional: broaden coverage on pre-push onlyTo keep pre-commit fast but catch cfg-gated code paths, consider a second hook limited to the pre-push stage with
--all-features(still with--no-deps). Example:- id: clippy name: clippy - entry: cargo clippy --workspace --lib --bins -- --no-deps -D warnings + entry: cargo clippy --workspace --lib --bins -- --no-deps -D warnings pass_filenames: false language: system + stages: [pre-commit] + + - id: clippy-pre-push-all-features + name: clippy (pre-push, all features) + entry: cargo clippy --workspace --lib --bins --all-features -- --no-deps -D warnings + pass_filenames: false + language: system + stages: [pre-push]
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
.pre-commit-config.yaml(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: boostsecurity - boostsecurityio/semgrep-pro
- GitHub Check: Analyze (rust)
🔇 Additional comments (1)
.pre-commit-config.yaml (1)
31-31: LGTM: Clippy now targets only internal code and ignores deps
--workspace --lib --binsscopes to our crates, and passing-- --no-deps -D warningsensures dependencies aren’t linted while still failing on warnings. Matches the PR objective.
Summary
This PR updates pre commit clippy command to avoid checking external deps
Testing Process
Checklist
Summary by CodeRabbit