# Clippy configuration for PMAT (v2.0)
# Based on: Learn from Rust Giants specification
# Elite projects analyzed: tokio, serde, clap, syn, regex

# Disallowed methods - enforce project-specific style preferences
# Note: unwrap()/expect() restrictions removed because serde_json::json! macro
# internally uses unwrap() in its expansion, causing ~4000 false positives.
# The json! macro is safe and the unwrap calls are in macro-generated code.
disallowed-methods = [
    # Avoid println! in library code - use tracing/logging instead
    # Note: allow-invalid = true suppresses "path is not a valid method" warnings for macros
    { path = "std::println", reason = "use tracing macros (info!, warn!, debug!) instead for library code", allow-invalid = true },
    { path = "std::eprintln", reason = "use tracing macros (error!, warn!) instead for library code", allow-invalid = true },

    # Remove debug statements before production
    { path = "std::dbg", reason = "remove debug statements or use proper logging", allow-invalid = true },

    # Extremely unsafe - almost always a code smell
    { path = "std::mem::transmute", reason = "transmute is extremely unsafe - find a safer alternative" },
]

# Cognitive complexity threshold (warn if function exceeds 25)
cognitive-complexity-threshold = 25

# Type complexity limit
type-complexity-threshold = 250

# Maximum line length
max-fn-params-bools = 3

# Allow certain lints for specific cases
# (These can be overridden in individual files with #[allow(...)])
