use super::{
    RuleConfigurability, RuleDefaultSeverity, RuleDefinition, RuleLanguage, RuleStatus, bindings,
};

pub(crate) const RULE_DEFINITIONS: &[RuleDefinition] = &[
    RuleDefinition {
        id: "rust_arc_mutex_option_state",
        language: RuleLanguage::Rust,
        family: "api_design",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Arc<Mutex<Option<T>>>-style state bags that hide lifecycle state behind nested mutation layers.",
        binding_location: bindings::RUST_API_DESIGN,
    },
    RuleDefinition {
        id: "rust_boolean_state_machine",
        language: RuleLanguage::Rust,
        family: "api_design",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "State structs encoded with multiple booleans instead of a dedicated enum.",
        binding_location: bindings::RUST_API_DESIGN,
    },
    RuleDefinition {
        id: "rust_borrowed_pathbuf_api",
        language: RuleLanguage::Rust,
        family: "api_design",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Public signatures that borrow &PathBuf instead of &Path.",
        binding_location: bindings::RUST_API_DESIGN,
    },
    RuleDefinition {
        id: "rust_borrowed_string_api",
        language: RuleLanguage::Rust,
        family: "api_design",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Public signatures that borrow &String instead of &str.",
        binding_location: bindings::RUST_API_DESIGN,
    },
    RuleDefinition {
        id: "rust_borrowed_vec_api",
        language: RuleLanguage::Rust,
        family: "api_design",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Public signatures that borrow &Vec<T> instead of &[T].",
        binding_location: bindings::RUST_API_DESIGN,
    },
    RuleDefinition {
        id: "rust_builder_without_validate",
        language: RuleLanguage::Rust,
        family: "api_design",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Builders that expose build() without an obvious validation step.",
        binding_location: bindings::RUST_API_DESIGN,
    },
    RuleDefinition {
        id: "rust_constructor_many_flags",
        language: RuleLanguage::Rust,
        family: "api_design",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Constructor-like APIs that use multiple boolean flags.",
        binding_location: bindings::RUST_API_DESIGN,
    },
    RuleDefinition {
        id: "rust_global_lock_state",
        language: RuleLanguage::Rust,
        family: "api_design",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Static or lazy global state wrapped in mutable lock-based containers.",
        binding_location: bindings::RUST_API_DESIGN,
    },
    RuleDefinition {
        id: "rust_mutex_wrapped_collection",
        language: RuleLanguage::Rust,
        family: "api_design",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Collection-plus-lock fields embedded directly in public or central state structs.",
        binding_location: bindings::RUST_API_DESIGN,
    },
    RuleDefinition {
        id: "rust_option_bag_config",
        language: RuleLanguage::Rust,
        family: "api_design",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Config-like structs with many Option fields and no obvious validation path.",
        binding_location: bindings::RUST_API_DESIGN,
    },
    RuleDefinition {
        id: "rust_partial_init_escape",
        language: RuleLanguage::Rust,
        family: "api_design",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Constructor-like functions that return or store partially initialized structs.",
        binding_location: bindings::RUST_API_DESIGN,
    },
    RuleDefinition {
        id: "rust_pub_interior_mutability_field",
        language: RuleLanguage::Rust,
        family: "api_design",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Public structs that expose Mutex, RwLock, RefCell, Cell, or similar fields directly.",
        binding_location: bindings::RUST_API_DESIGN,
    },
    RuleDefinition {
        id: "rust_public_anyhow_result",
        language: RuleLanguage::Rust,
        family: "api_design",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Public library-facing APIs that return anyhow-style Result types instead of a clearer domain error.",
        binding_location: bindings::RUST_API_DESIGN,
    },
    RuleDefinition {
        id: "rust_public_bool_parameter_api",
        language: RuleLanguage::Rust,
        family: "api_design",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Public APIs that expose a raw boolean mode switch.",
        binding_location: bindings::RUST_API_DESIGN,
    },
    RuleDefinition {
        id: "rust_public_box_dyn_error",
        language: RuleLanguage::Rust,
        family: "api_design",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Public APIs that expose Box<dyn Error> rather than a clearer error surface.",
        binding_location: bindings::RUST_API_DESIGN,
    },
    RuleDefinition {
        id: "rust_rc_refcell_domain_model",
        language: RuleLanguage::Rust,
        family: "api_design",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Domain-style structs built around Rc<RefCell<T>> instead of clearer ownership boundaries.",
        binding_location: bindings::RUST_API_DESIGN,
    },
    RuleDefinition {
        id: "rust_serde_default_on_required_field",
        language: RuleLanguage::Rust,
        family: "api_design",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Required-looking contract fields that opt into #[serde(default)].",
        binding_location: bindings::RUST_API_DESIGN,
    },
    RuleDefinition {
        id: "rust_serde_flatten_catchall",
        language: RuleLanguage::Rust,
        family: "api_design",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "#[serde(flatten)] catch-all maps or loose value bags that absorb unknown fields.",
        binding_location: bindings::RUST_API_DESIGN,
    },
    RuleDefinition {
        id: "rust_serde_unknown_fields_allowed",
        language: RuleLanguage::Rust,
        family: "api_design",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Strict-looking config or request structs that deserialize without deny_unknown_fields.",
        binding_location: bindings::RUST_API_DESIGN,
    },
    RuleDefinition {
        id: "rust_serde_untagged_enum_boundary",
        language: RuleLanguage::Rust,
        family: "api_design",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Boundary-facing enums that derive #[serde(untagged)] and risk ambiguous wire formats.",
        binding_location: bindings::RUST_API_DESIGN,
    },
    RuleDefinition {
        id: "rust_stringly_typed_enum_boundary",
        language: RuleLanguage::Rust,
        family: "api_design",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Enum-like boundary fields kept as String instead of a dedicated enum.",
        binding_location: bindings::RUST_API_DESIGN,
    },
];
