# ๐จ Ferrous Forge
**The Type-Safe Rust Development Standards Enforcer**
[](https://crates.io/crates/ferrous-forge)
[](https://docs.rs/ferrous-forge)
[](LICENSE)
[](https://github.com/kryptobaseddev/ferrous-forge/actions)
> *"Like a blacksmith forges iron into steel, Ferrous Forge shapes your Rust code into perfection."*
Ferrous Forge is a **system-wide Rust development standards enforcer** that automatically applies
professional-grade coding standards to your Rust projects. It integrates with cargo commands,
installs git hooks for pre-commit and pre-push validation, and provides a CLI for managing
Rust versions, editions, safety checks, and more.
## โจ Features
### ๐ฆ Rust Version Management
- **Version Checking** โ Check your Rust installation against latest GitHub releases
- **Update Recommendations** โ Intelligent update suggestions (security/major/minor)
- **Release Tracking** โ List recent Rust releases with dates and release notes
### ๐ Edition Management
- **Compliance Checking** โ Verify your project uses the latest Rust edition
- **Migration Assistant** โ Guided migration from older editions to Edition 2024
- **Compatibility Analysis** โ Pre-migration compatibility checking
- **Automated Fixes** โ Integration with `cargo fix --edition`
### ๐ก๏ธ Safety Pipeline
- **Pre-Commit Protection** โ Block commits that would fail CI
- **Pre-Push Validation** โ Comprehensive checks before pushing to remote
- **Publish Safety** โ Prevent broken crates from reaching crates.io
- **Emergency Bypass** โ Hotfix capability with audit logging
### ๐ง Standards Enforcement
- ๐ซ **Zero Underscore Bandaid** โ Eliminates `_parameter` lazy patterns
- ๐ **Edition 2024 Enforcement** โ Enforces latest Rust edition
- ๐ฏ **Comprehensive Clippy** โ Enforces `clippy::all`, `clippy::pedantic`, and `clippy::nursery` lint groups, plus specific denies for `unwrap_used` and `expect_used`
- ๐ **Size Limits** โ Default limits of 300-line files and 50-line functions (configurable)
- ๐ **Documentation Coverage** โ Enforces RustDoc for public APIs with configurable thresholds
- ๐ง **System-Wide Integration** โ Intercepts `cargo` and `rustc` commands via `ferrous-forge init`
- ๐ฏ **Zero Configuration** โ Works immediately after installation
- ๐ **Auto-Updates** โ Keeps standards current with the Rust ecosystem
- ๐งช **Testing Enforced** โ Requires comprehensive test coverage
- ๐ก๏ธ **Security First** โ Automatic vulnerability scanning via `cargo audit`
## ๐ Quick Start
```bash
# Install from crates.io
cargo install ferrous-forge
# Initialize system-wide standards (one-time setup)
ferrous-forge init
# Check your Rust version and get update recommendations
ferrous-forge rust check
# Check if your project uses the latest edition
ferrous-forge edition check
# That's it! All your Rust development now follows professional standards
cargo new my-project # Automatically uses Edition 2024 + standards
```
## ๐ฆ What Gets Enforced
### โ
Every `cargo new`:
- Edition 2024 configuration
- Comprehensive clippy lint groups enabled
- Structured Cargo.toml with metadata
- Pre-configured GitHub Actions CI/CD
- Git hooks for validation
- Professional project structure
### ๐ง Every `cargo build/test/run`:
- Clippy validation (zero warnings policy)
- Format checking and auto-correction
- Security audit scanning
- Documentation completeness verification
### ๐ซ Banned Patterns (produce compilation errors):
```rust
// โ These will cause compilation to fail:
fn bad_function(_unused: String) {} // Underscore bandaid
let _ = some_result; // Ignored results
some_value.unwrap(); // Unwrap in production
edition = "2021" // Wrong edition
```
## ๐ฏ CLI Reference
### Core Commands
| `ferrous-forge init` | Initialize system-wide standards (use `--project` for project-level setup) |
| `ferrous-forge status` | Show installation status and current configuration |
| `ferrous-forge update` | Update to latest version (supports `--channel`, `--rules-only`, `--dry-run`) |
| `ferrous-forge validate [path]` | Validate a project against standards |
| `ferrous-forge rollback <version>` | Rollback to a previous version |
| `ferrous-forge uninstall` | Remove Ferrous Forge from the system |
| `ferrous-forge config` | Manage configuration (`--set`, `--get`, `--list`, `--reset`) |
| `ferrous-forge fix [path]` | Auto-fix code violations (`--dry-run`, `--only`, `--skip`) |
### ๐ฆ Rust Version Management
| `ferrous-forge rust check` | Check current Rust version vs latest |
| `ferrous-forge rust recommend` | Get intelligent update recommendations |
| `ferrous-forge rust list` | List recent Rust releases |
### ๐ Edition Management
| `ferrous-forge edition check` | Check edition compliance |
| `ferrous-forge edition analyze` | Analyze compatibility before migrating |
| `ferrous-forge edition migrate [edition]` | Migrate to a new edition (default: 2024) |
### ๐ก๏ธ Safety Pipeline
| `ferrous-forge safety check` | Run safety checks (`--stage=pre-commit\|pre-push`) |
| `ferrous-forge safety test` | Test all safety checks |
| `ferrous-forge safety status` | View safety pipeline status |
| `ferrous-forge safety install` | Install git hooks for the safety pipeline |
### ๐ Template Management
| `ferrous-forge template` | Manage project templates |
## ๐ง CI/CD Setup
### GitHub Actions
The repository includes comprehensive CI/CD workflows. To use them in your fork:
1. **Codecov Integration** (optional):
- Sign up at [codecov.io](https://codecov.io)
- Add your repository
- Add `CODECOV_TOKEN` to your repository secrets
2. **GitHub Pages** (for documentation):
- Go to Settings โ Pages
- Enable GitHub Pages
- Set source to "GitHub Actions"
### Known CI Limitations
- **cargo-nextest**: Pinned to v0.9.72 for Rust 1.82 compatibility
- **Code coverage**: Requires Codecov token to avoid rate limits
- **Benchmarks**: Run in non-failing mode for stability
## โ๏ธ Configuration
Ferrous Forge supports hierarchical configuration (system, user, project levels). Key configurable values:
| `max_file_lines` | 300 | Maximum lines per file |
| `max_function_lines` | 50 | Maximum lines per function |
| `required_edition` | 2024 | Required Rust edition |
| `ban_underscore_bandaid` | true | Ban `_parameter` patterns |
| `require_documentation` | true | Require RustDoc on public APIs |
| `auto_update` | true | Automatically check for updates |
| `update_channel` | stable | Release channel (stable/beta/nightly) |
```bash
# View all settings
ferrous-forge config --list
# Change a setting
ferrous-forge config --set max_file_lines=400
# Reset to defaults
ferrous-forge config --reset
```
## ๐ Documentation
- [**๐ฆ Rust Ecosystem Guide**](docs/rust-ecosystem-guide.md) โ **New to Rust? Start here!**
- [**Installation Guide**](docs/installation.md) โ Detailed setup instructions
- [**Configuration**](docs/configuration.md) โ Customizing rules and settings
- [**Standards Reference**](docs/standards.md) โ Complete list of enforced rules
- [**Integration Guide**](docs/integration.md) โ IDE and tool integration
- [**Troubleshooting**](docs/troubleshooting.md) โ Common issues and solutions
- [**Migration Guide**](docs/migration.md) โ Upgrading existing projects
## ๐ ๏ธ Development & Contributing
We welcome contributions! Ferrous Forge is built with modern Rust practices:
- **Rust Edition 2024** (of course!)
- **100% Safe Rust** (no unsafe code)
- **Comprehensive Testing** (unit, integration, property-based)
- **CI/CD Pipeline** (automated testing, releases, security)
- **Documentation First** (every public API documented)
See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
### Development Setup
```bash
git clone https://github.com/kryptobaseddev/ferrous-forge
cd ferrous-forge
cargo install --path .
cargo test --all-features
cargo doc --open
```
## ๐๏ธ Architecture
Ferrous Forge operates at multiple levels:
```
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ System Level โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โข Global Cargo configuration โ
โ โข Cargo/rustc command interception โ
โ โข Rust toolchain management โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Project Level โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โข Template injection โ
โ โข Git hook installation โ
โ โข CI/CD configuration โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Runtime Level โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โข Clippy rule enforcement โ
โ โข Real-time validation โ
โ โข Documentation coverage checks โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
```
## ๐ Security
- **Sandboxed execution** โ No elevated privileges required
- **Dependency scanning** โ Automatic vulnerability detection via `cargo audit`
- **Supply chain awareness** โ Integrates with Rust security advisories
## ๐ License
Licensed under either of:
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE))
- MIT License ([LICENSE-MIT](LICENSE-MIT))
at your option.
## ๐ค Community
- **Issues**: [Bug Reports & Feature Requests](https://github.com/kryptobaseddev/ferrous-forge/issues)
- **Discussions**: [GitHub Discussions](https://github.com/kryptobaseddev/ferrous-forge/discussions)
## ๐ **My First Rust Crate!**
Hey there, fellow Rustaceans! ๐ This is my **very first Rust crate**, and I am absolutely **thrilled** to share it with the community!
After months of teaching myself Rust (what an incredible journey it's been!), and with the amazing power of **Claude Code** accelerating my learning exponentially, I've built something I hope you'll find useful. This tool was born from my own frustration with inconsistent code standards across projects, and my desire to enforce professional-grade Rust practices automatically.
**I'm super excited to learn and grow with the Rust community!** ๐ฆโจ
### ๐ฌ **Please, I Need Your Feedback!**
- ๐ค **Think this tool is useful?** Please let me know!
- ๐
**Think this is a stupid tool with no real need?** Tell me that too - you can't hurt my feelings! (LOL)
- ๐ **Have ideas for improvements?** I'm all ears!
- ๐ค **Want to contribute?** I'd be honored to have your help!
- ๐ **Spot any Rust anti-patterns?** Please teach me - I'm here to learn!
This is as much about my **Rust learning journey** as it is about building something useful. Thank you for taking the time to look at my work and for joining me on this adventure! ๐
---
**Forge better Rust, automatically.** ๐จ
[โญ Star us on GitHub](https://github.com/kryptobaseddev/ferrous-forge) โข [๐ฆ Install from Crates.io](https://crates.io/crates/ferrous-forge) โข [๐ Read the Docs](https://docs.rs/ferrous-forge)