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

pub(crate) const RULE_DEFINITIONS: &[RuleDefinition] = &[
    RuleDefinition {
        id: "blocking_sync_io_in_async",
        language: RuleLanguage::Python,
        family: "performance",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Synchronous network, subprocess, sleep, or file I/O calls made from async def functions.",
        binding_location: super::bindings::PYTHON_PERFORMANCE,
    },
    RuleDefinition {
        id: "deque_candidate_queue",
        language: RuleLanguage::Python,
        family: "performance",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Queue-style list operations like pop(0) or insert(0, ...) that may want collections.deque.",
        binding_location: super::bindings::PYTHON_PERFORMANCE,
    },
    RuleDefinition {
        id: "full_dataset_load",
        language: RuleLanguage::Python,
        family: "performance",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Calls that load an entire payload into memory instead of streaming.",
        binding_location: super::bindings::PYTHON_PERFORMANCE,
    },
    RuleDefinition {
        id: "list_materialization_first_element",
        language: RuleLanguage::Python,
        family: "performance",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "list(...)[0] style access that materializes a whole list just to read the first element.",
        binding_location: super::bindings::PYTHON_PERFORMANCE,
    },
    RuleDefinition {
        id: "list_membership_in_loop",
        language: RuleLanguage::Python,
        family: "performance",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Repeated membership checks against obviously list-like containers inside loops.",
        binding_location: super::bindings::PYTHON_PERFORMANCE,
    },
    RuleDefinition {
        id: "recursive_traversal_risk",
        language: RuleLanguage::Python,
        family: "performance",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Direct recursion in traversal-style helpers that may be safer as iterative walks for deep inputs.",
        binding_location: super::bindings::PYTHON_PERFORMANCE,
    },
    RuleDefinition {
        id: "repeated_len_in_loop",
        language: RuleLanguage::Python,
        family: "performance",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Repeated len(...) checks inside loops when the receiver appears unchanged locally.",
        binding_location: super::bindings::PYTHON_PERFORMANCE,
    },
    RuleDefinition {
        id: "string_concat_in_loop",
        language: RuleLanguage::Python,
        family: "performance",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Repeated string concatenation inside loops can create O(n^2) growth and extra allocations.",
        binding_location: super::bindings::PYTHON_PERFORMANCE,
    },
    RuleDefinition {
        id: "temporary_collection_in_loop",
        language: RuleLanguage::Python,
        family: "performance",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Loop-local list, dict, or set construction that likely adds avoidable allocation churn.",
        binding_location: super::bindings::PYTHON_PERFORMANCE,
    },
];
