Skip to main content

ferrous_forge/
lib.rs

1//! # Ferrous Forge
2//!
3//! The Type-Safe Rust Development Standards Enforcer
4//!
5//! Ferrous Forge is a comprehensive system-wide tool that automatically enforces
6//! professional Rust development standards across all projects on your machine.
7//!
8//! ## Features
9//!
10//! - Zero underscore bandaid coding enforcement
11//! - Edition 2024 automatic upgrades
12//! - System-wide cargo command hijacking
13//! - Automatic project template injection
14//! - Real-time code validation
15//! - Professional CI/CD setup
16//!
17//! ## Quick Start
18//!
19//! ```rust,no_run
20//! use ferrous_forge::{Config, Result};
21//!
22//! #[tokio::main]
23//! async fn main() -> Result<()> {
24//!     // Load or create default configuration
25//!     let config = Config::load_or_default().await?;
26//!     println!("Ferrous Forge v{}", ferrous_forge::VERSION);
27//!     println!("Required edition: {}", config.required_edition);
28//!     Ok(())
29//! }
30//! ```
31//!
32//! ### CLI Usage
33//!
34//! ```bash
35//! cargo install ferrous-forge
36//! ferrous-forge init
37//! cargo new my-project  # Now follows all standards automatically
38//! ```
39//!
40//! ## Modules
41//!
42//! ### Core
43//! - [`cli`] — Command line interface definitions and argument parsing
44//! - [`commands`] — Implementation of all Ferrous Forge commands
45//! - [`config`] — Configuration management and hierarchical config system
46//! - [`error`] — Error types and result handling
47//!
48//! ### Standards & Validation
49//! - [`standards`] — Development standards definitions and enforcement
50//! - [`validation`] — Core validation logic and rule enforcement
51//! - [`safety`] — Safety pipeline and enforcement mechanisms
52//! - [`formatting`] — Code formatting enforcement and validation
53//!
54//! ### Rust Ecosystem
55//! - [`edition`] — Rust edition management and upgrade assistance
56//! - [`rust_version`] — Rust version checking and compatibility validation
57//! - [`doc_coverage`] — Documentation coverage checking and reporting
58//! - [`security`] — Security auditing and vulnerability scanning
59//! - [`test_coverage`] — Test coverage integration and reporting
60//!
61//! ### Tooling
62//! - [`templates`] — Project template system and built-in templates
63//! - [`git_hooks`] — Git hooks installation and management
64//! - [`cargo_intercept`] — Cargo command interception for publish validation
65//! - [`updater`] — Self-update functionality and version management
66//!
67//! ### Analysis
68//! - [`ai_analyzer`] — AI-powered violation analysis and fix suggestions
69//! - [`performance`] — Performance optimizations for validation
70
71#![forbid(unsafe_code)]
72#![warn(missing_docs)]
73#![cfg_attr(docsrs, feature(doc_cfg))]
74
75/// AI-powered violation analysis and fix suggestions
76pub mod ai_analyzer;
77/// Cargo command interception for publish validation
78pub mod cargo_intercept;
79/// Command line interface definitions and argument parsing
80pub mod cli;
81/// Implementation of all Ferrous Forge commands
82pub mod commands;
83/// Configuration management and hierarchical config system
84pub mod config;
85/// Documentation coverage checking and reporting
86pub mod doc_coverage;
87/// Rust edition management and upgrade assistance
88pub mod edition;
89/// Error types and result handling
90pub mod error;
91/// Code formatting enforcement and validation
92pub mod formatting;
93/// Git hooks installation and management
94pub mod git_hooks;
95/// Performance optimizations for validation
96pub mod performance;
97/// Rust version checking and compatibility validation
98pub mod rust_version;
99/// Safety pipeline and enforcement mechanisms
100pub mod safety;
101/// Security auditing and vulnerability scanning
102pub mod security;
103/// Development standards definitions and enforcement
104pub mod standards;
105/// Project template system and built-in templates
106pub mod templates;
107/// Test coverage integration and reporting
108pub mod test_coverage;
109/// Self-update functionality and version management
110pub mod updater;
111/// Core validation logic and rule enforcement
112pub mod validation;
113
114// Re-export commonly used types
115pub use crate::config::Config;
116pub use crate::error::{Error, Result};
117
118/// Current version of Ferrous Forge
119pub const VERSION: &str = env!("CARGO_PKG_VERSION");
120
121/// Minimum supported Rust version
122pub const MIN_RUST_VERSION: &str = "1.82.0";
123
124/// Edition enforced by Ferrous Forge
125pub const REQUIRED_EDITION: &str = "2024";