Skip to content

cleanup(core): hold mailbox.rs test code to the god-level bar (--all-targets) #136

Description

@joeldsouzax

Component

bombay-core/src/mailbox.rs #[cfg(test)] module (lines ~429–678). Pre-existing on main (landed with #133); surfaced while implementing #113.

What

cargo clippy --all-targets reports 11 errors, all in the mailbox test module — invisible to the CI gate, which deliberately scopes clippy to lib + bins, not --all-targets (flake.nix:113; test code gets clippy.toml's allow-unwrap-in-tests/allow-expect-in-tests). So --all-targets is stricter than the gate.

The lints:

  • panic in production code (×2) — panic! in test helpers
  • silent as conversions (×4)
  • shadowed bindings (×3) — tx / start / capacity
  • large size difference between variants (×1) — a test-only enum
  • item in documentation missing backticks (×1)

The decision

The project bills itself "god-level bar from line one," yet test code is exempt from --all-targets lints. Two ways to make it consistent:

  1. Fix them and flip the gate to --all-targets (holds tests to the bar too).
  2. Extend the test-allows in clippy.toml (codify that tests may use panic!/as/shadowing).

Recommend (1) — the bar should mean what it says; test code that needs panic!/as usually has a cleaner form. Whichever is chosen, apply it workspace-wide, not just to mailbox.

Not in scope of

#113 (error module) — kept separate to keep that diff focused. Related: #61 (clippy ratchet), #133 (mailbox).

Metadata

Metadata

Assignees

No one assigned

    Labels

    cleanupDe-handroll: adopt best-in-class cratefoundationM1 foundation work

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions