Skip to content

Enable clippy::panic lint #91

Description

@tupe12334

What this lint catches

clippy::panic warns on any explicit panic!() call in non-test production code. Panics that reach users produce cryptic crash output and bypass the crate's anyhow-based error propagation. This lint enforces that every failure path is either returned as an Err or, when a code path is genuinely unreachable, expressed with unreachable!() — which is semantically precise and excluded from this lint.

Why it improves code quality

This codebase already forbids dbg! and todo! to prevent debug artefacts from shipping. clippy::panic closes the analogous gap for accidental panics:

  • Explicitnessunreachable!() signals intent (this arm cannot be reached), while panic!() is ambiguous.
  • Consistency — matches the existing spirit of dbg_macro = "deny" and todo = "deny".
  • Error hygiene — keeps all error paths routed through anyhow::Result and out of crash-and-burn territory.

Current state

No violations exist in production code. Test files use panic!() in match fallback arms that are genuinely unreachable; those are fixed by replacing them with unreachable!().


This issue was opened by the Clippy lint improvements → issue + PR (Rust repos) → Slack routine of moadim. CC @tupe12334

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions