/// Output format for results.
///
/// This is CLI-only (via `--format` flag), not stored in config files.
#[derive(Debug, Default, Clone, Copy)]
pub enum OutputFormat {
    /// Human-readable terminal output with source context.
    #[default]
    Human,
    /// Machine-readable JSON.
    Json,
    /// SARIF format for GitHub Code Scanning.
    Sarif,
    /// One issue per line (grep-friendly).
    Compact,
    /// Markdown for PR comments.
    Markdown,
    /// `CodeClimate` JSON for GitLab Code Quality.
    CodeClimate,
    /// Shields.io-compatible SVG badge (health command only).
    Badge,
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn output_format_default_is_human() {
        let format = OutputFormat::default();
        assert!(matches!(format, OutputFormat::Human));
    }

    #[test]
    fn output_format_all_variants_constructible() {
        // Verify all variants can be constructed and pattern-matched
        assert!(matches!(OutputFormat::Human, OutputFormat::Human));
        assert!(matches!(OutputFormat::Json, OutputFormat::Json));
        assert!(matches!(OutputFormat::Sarif, OutputFormat::Sarif));
        assert!(matches!(OutputFormat::Compact, OutputFormat::Compact));
        assert!(matches!(OutputFormat::Markdown, OutputFormat::Markdown));
        assert!(matches!(
            OutputFormat::CodeClimate,
            OutputFormat::CodeClimate
        ));
        assert!(matches!(OutputFormat::Badge, OutputFormat::Badge));
    }

    #[test]
    fn output_format_debug_impl() {
        // Verify Debug is derived and produces reasonable output
        let human = format!("{:?}", OutputFormat::Human);
        assert_eq!(human, "Human");
        let json = format!("{:?}", OutputFormat::Json);
        assert_eq!(json, "Json");
        let sarif = format!("{:?}", OutputFormat::Sarif);
        assert_eq!(sarif, "Sarif");
        let compact = format!("{:?}", OutputFormat::Compact);
        assert_eq!(compact, "Compact");
        let markdown = format!("{:?}", OutputFormat::Markdown);
        assert_eq!(markdown, "Markdown");
        let codeclimate = format!("{:?}", OutputFormat::CodeClimate);
        assert_eq!(codeclimate, "CodeClimate");
        let badge = format!("{:?}", OutputFormat::Badge);
        assert_eq!(badge, "Badge");
    }

    #[test]
    fn output_format_copy() {
        let original = OutputFormat::Json;
        let copied = original;
        assert!(matches!(copied, OutputFormat::Json));
        // Original still usable (Copy)
        assert!(matches!(original, OutputFormat::Json));
    }
}
