Skip to content

ci: add fmt and clippy checks for firmware packages#600

Merged
rgoulter merged 3 commits into
masterfrom
ci-firmware-clippy
Jul 12, 2026
Merged

ci: add fmt and clippy checks for firmware packages#600
rgoulter merged 3 commits into
masterfrom
ci-firmware-clippy

Conversation

@rgoulter

Copy link
Copy Markdown
Owner

Summary

The host rust.yaml clippy 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's cargo fmt check.

This PR closes that gap by adding cargo-fmt-clippy jobs to the firmware target workflows, and fixes existing clippy findings so the new guards pass with -D warnings.

Changes

  1. rp2040-rtic-smart-keyboard — clippy cleanups for the thumbv6m-none-eabi target (matrix init, unused shared resources, pin-setup too_many_arguments, usb_poll locking).
  2. stm32-embassy-smart-keyboard — clippy cleanups for the thumbv7em-none-eabihf target (first() vs get(0), is_ok(), unused import).
  3. CI
    • rust-thumbv6m-none-eabi.yaml: fmt + clippy for rp2040-rtic-smart-keyboard (--examples --bins).
    • rust-stm32f4.yaml: fmt + clippy for stm32f4-rtic-smart-keyboard and stm32-embassy-smart-keyboard (--examples --bins).

stm32f4-rtic-smart-keyboard was already clippy-clean; no source changes needed there.

Test plan

  • cargo fmt --all -- --check
  • cargo clippy --target thumbv6m-none-eabi -p rp2040-rtic-smart-keyboard --examples --bins -- -D warnings
  • cargo clippy --target thumbv7em-none-eabihf -p stm32f4-rtic-smart-keyboard -p stm32-embassy-smart-keyboard --examples --bins -- -D warnings
  • Confirm new cargo-fmt-clippy jobs pass on this PR's firmware workflows

rgoulter added 3 commits July 12, 2026 13:55
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.
@rgoulter
rgoulter merged commit 81cf282 into master Jul 12, 2026
4 checks passed
@rgoulter
rgoulter deleted the ci-firmware-clippy branch July 12, 2026 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant