ci: add fmt and clippy checks for firmware packages#600
Merged
Conversation
Clear lints that would fail -D warnings on the firmware target: use expect for infallible matrix init, drop unused usb_serial from tick tasks, allow too_many_arguments for pin setup, and call usb_poll via lock(usb_poll).
Clear lints that would fail -D warnings on the STM32 firmware target: prefer first() over get(0), is_ok() over if-let Ok, and drop an unused HidReader import.
The host rust.yaml clippy job excludes the embedded firmware crates. Add cargo-fmt-clippy jobs to the thumbv6m and stm32f4 workflows so those packages get rustfmt and clippy (-D warnings) coverage on their cross-compile targets.
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.
Summary
The host
rust.yamlclippy job deliberately excludes the embedded firmware crates (rp2040-rtic-smart-keyboard,stm32f4-rtic-smart-keyboard,stm32-embassy-smart-keyboard). Path filters also mean firmware-only changes may never hit that workflow'scargo fmtcheck.This PR closes that gap by adding
cargo-fmt-clippyjobs to the firmware target workflows, and fixes existing clippy findings so the new guards pass with-D warnings.Changes
rp2040-rtic-smart-keyboard— clippy cleanups for thethumbv6m-none-eabitarget (matrix init, unused shared resources, pin-setuptoo_many_arguments,usb_polllocking).stm32-embassy-smart-keyboard— clippy cleanups for thethumbv7em-none-eabihftarget (first()vsget(0),is_ok(), unused import).rust-thumbv6m-none-eabi.yaml: fmt + clippy forrp2040-rtic-smart-keyboard(--examples --bins).rust-stm32f4.yaml: fmt + clippy forstm32f4-rtic-smart-keyboardandstm32-embassy-smart-keyboard(--examples --bins).stm32f4-rtic-smart-keyboardwas already clippy-clean; no source changes needed there.Test plan
cargo fmt --all -- --checkcargo clippy --target thumbv6m-none-eabi -p rp2040-rtic-smart-keyboard --examples --bins -- -D warningscargo clippy --target thumbv7em-none-eabihf -p stm32f4-rtic-smart-keyboard -p stm32-embassy-smart-keyboard --examples --bins -- -D warningscargo-fmt-clippyjobs pass on this PR's firmware workflows