Make clippy pedantic clean across the workspace #92

Merged
littlefox merged 1 commit from clippy-pedantic-clean into main 2026-10-18 09:07:09 +00:00
Owner

Closes #91

PR #80 turned on clippy::pedantic. This makes the workspace pass cargo clippy --workspace --all-targets -- -D warnings with it, both natively and for wasm32 (D-035).

  • Casts that could truncate now use try_from, (0u8..).zip(..) or explicit byte picks, so no value is silently cut.
  • Every public fn returning Result documents its errors. Kom and wire::Reader do it once on the type, with an #[expect] on the impl.
  • Each lint we disagree with at one spot has an #[expect(..., reason)]: long seeding script, flag structs, size display. Nothing is allowed workspace-wide.
  • Generated code: #[must_use] comes from tools/gen-kom-proto.py, and other lints are allowed on the module, so --check still passes.
  • clippy.toml lists LysKOM and NeoKOM as valid names in docs.
  • CI gains a "Clippy (web build)" step for the browser-only code.

Verified: clippy is clean on both targets, unit tests pass, the 9 devserver tests pass, and tools/e2e.sh passes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8

Closes #91 PR #80 turned on `clippy::pedantic`. This makes the workspace pass `cargo clippy --workspace --all-targets -- -D warnings` with it, both natively and for wasm32 (D-035). - Casts that could truncate now use `try_from`, `(0u8..).zip(..)` or explicit byte picks, so no value is silently cut. - Every public fn returning `Result` documents its errors. `Kom` and `wire::Reader` do it once on the type, with an `#[expect]` on the impl. - Each lint we disagree with at one spot has an `#[expect(..., reason)]`: long seeding script, flag structs, size display. Nothing is allowed workspace-wide. - Generated code: `#[must_use]` comes from `tools/gen-kom-proto.py`, and other lints are allowed on the module, so `--check` still passes. - `clippy.toml` lists LysKOM and NeoKOM as valid names in docs. - CI gains a "Clippy (web build)" step for the browser-only code. Verified: clippy is clean on both targets, unit tests pass, the 9 devserver tests pass, and `tools/e2e.sh` passes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8
Make clippy pedantic clean across the workspace
All checks were successful
ci / check (push) Successful in 7m16s
ci / desktop (push) Successful in 12m34s
ci / e2e (push) Successful in 18m5s
810ad33f7f
PR #80 turned on clippy::pedantic and CLAUDE.md now asks for
`cargo clippy --workspace -- -D warnings` to pass (D-035).

Mechanical fixes came from `clippy --fix`, then tidied by hand. Casts
that could truncate now use try_from or explicit byte picks. Every
public fn returning Result documents its errors; Kom and Reader say it
once on the type, since all their methods fail the same way. Lints we
disagree with at one place carry #[expect(..., reason)]. Nothing is
allowed workspace-wide.

Generated code: #[must_use] comes from tools/gen-kom-proto.py, and the
rest is allowed on the generated module, so --check still passes.
clippy.toml lists LysKOM and NeoKOM as names rather than code. CI also
lints the wasm32 build, where the browser-only code lives.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8
littlefox referenced this pull request from a commit 2026-10-18 14:33:48 +00:00
Sign in to join this conversation.
No description provided.