Make the workspace clippy-clean and deny warnings in CI #37

Open
opened 2026-09-19 20:00:58 +00:00 by toasterson · 0 comments
Owner

Goal

cargo clippy --workspace --all-targets --all-features -- -D warnings currently fails with ~270 findings in libips (lib) and ~320 with tests. The Solstice CI linux job therefore runs clippy report-only. Make the workspace clippy-clean and flip the CI step in .forgejo/workflows/ci.yml to -- -D warnings.

Breakdown (from a local run, rustc stable 2026-07)

Lint Count Suggested handling
result_large_err (the Err-variant returned from this function is very large) ~149 Box the large error payloads or the miette diagnostics in the subsystem error enums (ImageError, RepositoryError, ...) so Result<T, E> stays small; alternatively #![allow(clippy::result_large_err)] at crate level with a justification if boxing hurts the diagnostic ergonomics. Decide once, apply everywhere.
collapsible_if 53 Mechanical; cargo clippy --fix handles most.
field_reassign_with_default 31 Mechanical.
Misc (needless_borrow, manual_*, derivable_impls, from_str_radix_10, new_without_default, ...) ~40 Mechanical.

Acceptance

  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings exits 0 on Linux and illumos.
  • CI step renamed back to "Clippy (deny warnings)".
  • No behaviour changes; cargo nextest run --workspace still green.

Do the mechanical lints in one commit (cargo clippy --fix --allow-dirty, then review), and the result_large_err decision in a separate commit so it can be reviewed on its own.

## Goal `cargo clippy --workspace --all-targets --all-features -- -D warnings` currently fails with ~270 findings in `libips` (lib) and ~320 with tests. The Solstice CI `linux` job therefore runs clippy report-only. Make the workspace clippy-clean and flip the CI step in `.forgejo/workflows/ci.yml` to `-- -D warnings`. ## Breakdown (from a local run, rustc stable 2026-07) | Lint | Count | Suggested handling | |------|-------|--------------------| | `result_large_err` (the `Err`-variant returned from this function is very large) | ~149 | Box the large error payloads or the miette diagnostics in the subsystem error enums (`ImageError`, `RepositoryError`, ...) so `Result<T, E>` stays small; alternatively `#![allow(clippy::result_large_err)]` at crate level with a justification if boxing hurts the diagnostic ergonomics. Decide once, apply everywhere. | | `collapsible_if` | 53 | Mechanical; `cargo clippy --fix` handles most. | | `field_reassign_with_default` | 31 | Mechanical. | | Misc (`needless_borrow`, `manual_*`, `derivable_impls`, `from_str_radix_10`, `new_without_default`, ...) | ~40 | Mechanical. | ## Acceptance - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings` exits 0 on Linux and illumos. - CI step renamed back to "Clippy (deny warnings)". - No behaviour changes; `cargo nextest run --workspace` still green. Do the mechanical lints in one commit (`cargo clippy --fix --allow-dirty`, then review), and the `result_large_err` decision in a separate commit so it can be reviewed on its own.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
OpenIndiana/ips#37
No description provided.