-
Notifications
You must be signed in to change notification settings - Fork 37
Add panic lints to CI #536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds panic-related clippy lints to the CI pipeline by configuring them in Cargo.toml rather than as command-line flags. The eSPI module is excluded from the indexing_slicing lint as noted in the PR description.
- Centralizes clippy lint configuration in
Cargo.tomlwith 11 strict lints including panic detection and code quality rules - Simplifies CI clippy commands to rely on the workspace lint configuration instead of explicit command-line flags
- Excludes the eSPI module from
indexing_slicinglint enforcement
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
Cargo.toml |
Adds [lints.clippy] section with 11 deny-level lints for panic detection, code quality, and best practices |
src/lib.rs |
Adds #[allow(clippy::indexing_slicing)] attribute to espi module to exclude it from the new lint |
ci.sh |
Simplifies clippy commands from explicit lint flags to just -Dwarnings, relying on Cargo.toml configuration |
.github/workflows/check.yml |
Simplifies clippy command for examples from explicit lint flags to just -Dwarnings |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's odd that keyboard-service and thermal-service don't generate panic lint warnings here in CI (they do for me locally). Regardless could make sense to exclude them as well for the time-being since they aren't used externally.
b0aadc6 to
bf00d12
Compare
* Exclude eSPI module as no external client yet
bf00d12 to
fea59d3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request introduces stricter Clippy lint enforcement at the project level and updates how Clippy lints are handled in the CI script. The main goal is to ensure code quality by denying a wide range of lints by default, while simplifying the Clippy invocation in CI. Additionally, a specific lint is suppressed for the
espimodule.Lint configuration improvements:
Added a
[lints.clippy]section toCargo.tomlto deny several categories of Clippy lints globally, includingcorrectness,expect_used,indexing_slicing,panic,perf,suspicious,style,todo,unimplemented,unreachable, andunwrap_used.Added
#[allow(clippy::indexing_slicing)]to theespimodule declaration insrc/lib.rsto suppress this lint specifically for that module.CI configuration changes:
ci.shby removing explicit lint deny flags from the command line, relying instead on the lints configured inCargo.toml.