1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
//! # SARIF Rust Library
//!
//! A comprehensive Rust library for parsing, generating, and manipulating
//! SARIF (Static Analysis Results Interchange Format) v2.1.0 files.
//!
//! SARIF is a standard JSON format for the output of static analysis tools.
//! This library provides complete support for the SARIF v2.1.0 specification
//! with type-safe parsing, generation, validation, and manipulation capabilities.
//!
//! ## Features
//!
//! - **Complete SARIF v2.1.0 Support**: Full specification compliance with all optional fields
//! - **Type-Safe API**: Leverages Rust's type system for correctness and safety
//! - **Builder Pattern**: Ergonomic API for programmatic SARIF generation
//! - **Advanced Querying**: Powerful filtering and search capabilities
//! - **Merge & Diff**: Combine multiple SARIF files or compare them
//! - **Multiple Formats**: Export to CSV, HTML, GitHub Security Advisory format
//! - **High Performance**: Streaming parser for large files with memory efficiency
//! - **Comprehensive Validation**: Multiple validation levels from minimal to pedantic
//! - **Schema Evolution**: Automatic migration between SARIF versions
//!
//! ## Quick Start
//!
//! ### Parsing SARIF Files
//!
//! ```rust,no_run
//! use sarif_rust::SarifLog;
//!
//! // Parse from file
//! let sarif: SarifLog = sarif_rust::from_file("results.sarif")?;
//!
//! // Parse from string
//! let json_content = std::fs::read_to_string("results.sarif")?;
//! let sarif: SarifLog = sarif_rust::from_str(&json_content)?;
//!
//! // Access results
//! for run in &sarif.runs {
//! println!("Tool: {}", run.tool.driver.name);
//! if let Some(results) = &run.results {
//! for result in results {
//! println!(" Issue: {}",
//! result.message.text.as_deref().unwrap_or("no message"));
//! }
//! }
//! }
//! # Ok::<(), Box<dyn std::error::Error>>(())
//! ```
//!
//! ### Building SARIF Files
//!
//! ```rust
//! use sarif_rust::SarifLogBuilder;
//!
//! // Create a basic SARIF log
//! let sarif = SarifLogBuilder::new()
//! .with_schema("https://json.schemastore.org/sarif-2.1.0.json")
//! .build_unchecked(); // Note: use build()? for validation
//!
//! // Convert to JSON
//! let json = sarif_rust::to_string_pretty(&sarif)?;
//! println!("{}", json);
//! # Ok::<(), Box<dyn std::error::Error>>(())
//! ```
//!
//! ## Error Handling
//!
//! All operations return `Result<T, SarifError>` where `SarifError` provides
//! detailed information about what went wrong:
//!
//! ```rust,no_run
//! use sarif_rust::SarifError;
//!
//! match sarif_rust::from_file("invalid.sarif") {
//! Ok(sarif) => println!("Parsed successfully"),
//! Err(SarifError::Io(e)) => eprintln!("IO error: {}", e),
//! Err(SarifError::Json(e)) => eprintln!("JSON parsing error: {}", e),
//! Err(SarifError::Validation(e)) => eprintln!("Validation error: {}", e),
//! Err(e) => eprintln!("Other error: {}", e),
//! }
//! # Ok::<(), Box<dyn std::error::Error>>(())
//! ```
// Re-export core types
pub use *;
pub use *;
pub use *;
// Core modules
/// Re-export commonly used types and functions for convenience
// Re-export common functions
pub use ;
/// Library version
pub const VERSION: &str = env!;
/// SARIF specification version supported
pub const SARIF_VERSION: &str = "2.1.0";