ferret/clippy.toml

34 lines
1.6 KiB
TOML
Executable File

# clippy.toml — ferret lint configuration
#
# Stricter than defaults. Run: cargo clippy --release -- -D warnings
# Disallow large enum variants without #[allow] — catches accidental
# memory bloat in hot-path enums like Cmd and EngineEvent.
enum-variant-size-threshold = 256
# NOTE: `struct-field-size-threshold` was never a recognized clippy.toml
# key on current toolchains and hard-fails config parsing (the related
# struct-bloat lints are field-count based, not size based). Removed so
# `cargo clippy` runs at all; see PlaybackState's #[allow]s for the
# "too many fields" side of the original intent.
# Single-use bindings are often a sign of "extract this to a named variable
# for clarity" — but sometimes they're just noise. Keep the lint at warn
# (default) so we see them without failing the build.
# Long literal strings should be broken across lines for readability —
# but only flag if the line exceeds 120 chars.
single-char-binding-names-threshold = 2
# Don't flag `fn main() -> Result<()>` — that's idiomatic for anyhow.
# (clippy::main_recursion is already allow-by-default.)
# Allow the `?` operator in FFI wrappers — the alternative (explicit match)
# is more verbose without being clearer for the `MpvError::from_code` pattern.
# This is a per-crate allow in mpv-bindings, not a global suppression.
# Cognitive complexity threshold — functions above this get flagged.
# The engine's `apply_cmd` match is intentionally large (one arm per Cmd
# variant); it carries #[allow(clippy::cognitive_complexity)] if needed.
cognitive-complexity-threshold = 50