Skip to main content

llm_config_devtools/
lib.rs

1//! LLM Config Manager Development Tools
2//!
3//! This crate provides enterprise-grade security scanning and development tools
4//! for the LLM Config Manager project.
5//!
6//! # Features
7//!
8//! - **Security Scanning**: Comprehensive code security analysis
9//!   - Clippy security lints integration
10//!   - Unsafe code detection
11//!   - Secret scanning
12//!   - SQL injection vulnerability detection
13//!
14//! - **Report Generation**: Multiple output formats
15//!   - JSON (machine-readable)
16//!   - YAML (human-readable structured)
17//!   - Markdown (documentation)
18//!   - SARIF (GitHub Security integration)
19//!
20//! # Usage
21//!
22//! ## As a Library
23//!
24//! ```rust,no_run
25//! use llm_config_devtools::security::{SecurityScanner, ScanConfig};
26//! use llm_config_devtools::report::{generate_report, OutputFormat};
27//! use std::path::PathBuf;
28//!
29//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
30//! let config = ScanConfig {
31//!     project_root: PathBuf::from("."),
32//!     scan_clippy: true,
33//!     scan_unsafe: true,
34//!     scan_secrets: true,
35//!     scan_sql: true,
36//!     max_workers: None,
37//! };
38//!
39//! let scanner = SecurityScanner::new(config);
40//! let report = scanner.scan()?;
41//!
42//! let markdown = generate_report(&report, OutputFormat::Markdown)?;
43//! println!("{}", markdown);
44//! # Ok(())
45//! # }
46//! ```
47//!
48//! ## As a CLI Tool
49//!
50//! ```bash
51//! # Run security scan
52//! llm-security-scan --output report.md --format markdown
53//!
54//! # Generate SARIF for GitHub
55//! llm-security-scan --output results.sarif --format sarif
56//! ```
57
58#![warn(missing_docs)]
59#![warn(clippy::all)]
60#![warn(clippy::pedantic)]
61#![warn(clippy::nursery)]
62#![allow(clippy::module_name_repetitions)]
63
64pub mod error;
65pub mod report;
66pub mod security;
67
68pub use error::{DevtoolsError, Result};
69
70#[cfg(test)]
71mod tests {
72    use super::*;
73
74    #[test]
75    fn test_library_exports() {
76        // Verify key types are exported
77        let _: Result<()> = Ok(());
78    }
79}