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

pub(crate) const RULE_DEFINITIONS: &[RuleDefinition] = &[
    RuleDefinition {
        id: "broad_exception_handler",
        language: RuleLanguage::Python,
        family: "maintainability",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Broad except Exception: style handlers that still obscure failure shape even when not fully swallowed.",
        binding_location: super::bindings::PYTHON_MAINTAINABILITY,
    },
    RuleDefinition {
        id: "builtin_reduction_candidate",
        language: RuleLanguage::Python,
        family: "maintainability",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Loop shapes that look like obvious sum, any, or all candidates.",
        binding_location: super::bindings::PYTHON_MAINTAINABILITY,
    },
    RuleDefinition {
        id: "commented_out_code",
        language: RuleLanguage::Python,
        family: "maintainability",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Blocks of commented-out source code left in production files.",
        binding_location: super::bindings::PYTHON_MAINTAINABILITY,
    },
    RuleDefinition {
        id: "environment_boundary_without_fallback",
        language: RuleLanguage::Python,
        family: "maintainability",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Environment-variable lookups that omit a default value or explicit failure handler.",
        binding_location: super::bindings::PYTHON_MAINTAINABILITY,
    },
    RuleDefinition {
        id: "eval_exec_usage",
        language: RuleLanguage::Python,
        family: "maintainability",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Direct eval() or exec() usage in non-test Python code.",
        binding_location: super::bindings::PYTHON_MAINTAINABILITY,
    },
    RuleDefinition {
        id: "exception_swallowed",
        language: RuleLanguage::Python,
        family: "maintainability",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Broad exception handlers like except: or except Exception: that immediately suppress the error with pass, continue, break, or return.",
        binding_location: super::bindings::PYTHON_MAINTAINABILITY,
    },
    RuleDefinition {
        id: "external_input_without_validation",
        language: RuleLanguage::Python,
        family: "maintainability",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Request or CLI entry points that trust external input without obvious validation or guard checks.",
        binding_location: super::bindings::PYTHON_MAINTAINABILITY,
    },
    RuleDefinition {
        id: "hardcoded_business_rule",
        language: RuleLanguage::Python,
        family: "maintainability",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Hardcoded threshold, rate-limit, or pricing-style literals assigned inside non-test Python functions.",
        binding_location: super::bindings::PYTHON_MAINTAINABILITY,
    },
    RuleDefinition {
        id: "hardcoded_path_string",
        language: RuleLanguage::Python,
        family: "maintainability",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Hardcoded filesystem path literals assigned inside non-test Python functions.",
        binding_location: super::bindings::PYTHON_MAINTAINABILITY,
    },
    RuleDefinition {
        id: "magic_value_branching",
        language: RuleLanguage::Python,
        family: "maintainability",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Repeated branch-shaping numeric or string literals that likely want an explicit constant or policy name.",
        binding_location: super::bindings::PYTHON_MAINTAINABILITY,
    },
    RuleDefinition {
        id: "missing_context_manager",
        language: RuleLanguage::Python,
        family: "maintainability",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Resource management (files, network connections) inside non-test Python functions that omits with-statement context managers.",
        binding_location: super::bindings::PYTHON_MAINTAINABILITY,
    },
    RuleDefinition {
        id: "mixed_sync_async_module",
        language: RuleLanguage::Python,
        family: "maintainability",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Modules that expose public sync and async entry points together.",
        binding_location: super::bindings::PYTHON_MAINTAINABILITY,
    },
    RuleDefinition {
        id: "network_boundary_without_timeout",
        language: RuleLanguage::Python,
        family: "maintainability",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Request, sync, or job-style Python functions that call HTTP boundaries with no obvious timeout or retry policy.",
        binding_location: super::bindings::PYTHON_MAINTAINABILITY,
    },
    RuleDefinition {
        id: "none_comparison",
        language: RuleLanguage::Python,
        family: "maintainability",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "== None or != None checks instead of is None or is not None.",
        binding_location: super::bindings::PYTHON_MAINTAINABILITY,
    },
    RuleDefinition {
        id: "print_debugging_leftover",
        language: RuleLanguage::Python,
        family: "maintainability",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "print() calls left in non-test Python functions that do not look like obvious main-entrypoint output.",
        binding_location: super::bindings::PYTHON_MAINTAINABILITY,
    },
    RuleDefinition {
        id: "public_api_missing_type_hints",
        language: RuleLanguage::Python,
        family: "maintainability",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Public Python functions that omit complete parameter or return annotations.",
        binding_location: super::bindings::PYTHON_MAINTAINABILITY,
    },
    RuleDefinition {
        id: "redundant_return_none",
        language: RuleLanguage::Python,
        family: "maintainability",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Explicit return None in simple code paths where Python would already return None implicitly.",
        binding_location: super::bindings::PYTHON_MAINTAINABILITY,
    },
    RuleDefinition {
        id: "reinvented_utility",
        language: RuleLanguage::Python,
        family: "maintainability",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Obvious locally implemented utility helpers that overlap with already-imported standard-library style helpers.",
        binding_location: super::bindings::PYTHON_MAINTAINABILITY,
    },
    RuleDefinition {
        id: "side_effect_comprehension",
        language: RuleLanguage::Python,
        family: "maintainability",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "List, set, or dicit comprehensions used as standalone statements where the result is discarded.",
        binding_location: super::bindings::PYTHON_MAINTAINABILITY,
    },
    RuleDefinition {
        id: "variadic_public_api",
        language: RuleLanguage::Python,
        family: "maintainability",
        default_severity: RuleDefaultSeverity::Contextual,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Public Python functions that expose *args or **kwargs instead of a clearer interface.",
        binding_location: super::bindings::PYTHON_MAINTAINABILITY,
    },
];
