Repository navigation
zephyr-build, zephyr-macros: pass clippy -D warnings - #1
Open
JPHutchins wants to merge 3 commits into
Open
JPHutchins wants to merge 3 commits into
JPHutchins wants to merge 3 commits into
Conversation
This was referenced Oct 28, 2026
The devicetree code generator emits one `pub static RAW_*: &'static [crate::devicetree::Value]` per property. Statics are already 'static, so clippy's redundant_static_lifetimes rejects every one of them: 167 errors for a native_sim/native/64 build when the zephyr crate is linted with the module's own clippy flags (-D warnings -D clippy::undocumented_unsafe_blocks). CI never reported this because the module's clippy target lints only the application crate. The zephyr crate is a patched path dependency, not a workspace member, so cargo does not run clippy-driver on it. Assisted-by: Claude:claude-opus-5-5
clippy::collapsible_match rejects the nested `if` inside the `Value::Words` arm of `property_walk`, so `cargo clippy -- -D warnings` fails on this host crate. Match the single number with a slice pattern instead, and make each arm an expression rather than an early `return`. The generated devicetree.rs for native_sim/native/64 is byte-identical before and after. Assisted-by: Claude:claude-opus-5-5
`cargo clippy -- -D warnings` fails on this host crate: `!x.is_none()` is `x.is_some()` (nonminimal_bool), and comparing an `Ident` against a string does not need `to_string()` first (cmp_owned). Applied with `cargo clippy --fix`. Assisted-by: Claude:claude-opus-5-5
JPHutchins
force-pushed
the
clippy/1-host-crates
branch
from
October 28, 2026 23:34
3114303 to
0a6edeb
Compare
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.
Warning
LLM Disclosure
This post was authored by claude-opus-5-5 on behalf of @JPHutchins. JP asked to bring zephyr-lang-rust under strict clippy rules matching embassy's (default groups,
-D warnings), to report deficiencies found along the way, and to open the work as a stacked series of review PRs on the intercreate fork.zephyr-buildandzephyr-macrosfailcargo clippy -- -D warnings. The devicetree code generator also emits&'staticon every generatedstatic, which adds oneredundant_static_lifetimeserror per devicetree property (167 for native_sim/native/64) once thezephyrcrate is linted. No behavior change: the generateddevicetree.rsfor native_sim/native/64 is byte-identical before and after the refactor.Stack, merge in order:
zephyrcrate passes the module's clippy flagsclippy_zephyrtarget and CIembedded_hal_async::digital::WaitforGpioPinCommits
3c2727a5a43ezephyr-build: drop redundant 'static from generated statics07bc53cb2419zephyr-build: match single-value properties with slice patterns0a6edeb6c500zephyr-macros: fix clippy nonminimal_bool and cmp_ownedThe generator change:
zephyr-build/src/devicetree/augment.rs#L174The slice pattern:
zephyr-build/src/devicetree/output.rs#L99Testing
cargo fmt --checkandcargo clippy --all-targets -- -D warningspass inzephyr-build, andcargo clippy -- -D warningspasses inzephyr-macros.devicetree.rsgenerated forsamples/hello_worldon native_sim/native/64 compared withcmpbefore and after the slice-pattern commit: identical.samples/hello_worldbuilds for native_sim/native/64 at this PR's head.Review notes