The Aggressive Rust Development Standards Enforcer
"Like a blacksmith forges iron into steel, Ferrous Forge shapes your Rust code into perfection." Ferrous Forge is an opinionated, aggressive Rust development standards enforcer. Unlike other tools that suggest fixes, Forge physically prevents non-compliant code from being committed, pushed, or published. Version: 1.7.6 | MSRV: 1.88 (Rust Edition 2024) | License: MIT OR Apache-2.0
- Preconfiguration β Professional-grade standards from project creation
- Locking β Critical settings are immutable without explicit justification
- Enforcement β Blocks git operations by default when checks fail
- Agent-Proof β Prevents LLM agents from "workaround-ing" standards
- Escape Hatches β Bypass available with mandatory audit logging
# Install from crates.io
cargo install ferrous-forge
# Initialize system-wide (one-time setup)
ferrous-forge init
# Create a new project with Forge standards
cargo new my-project
cd my-project
ferrous-forge init --project
# That's it! All your development now follows professional standards
git commit -m "feat: initial commit" # Will be validatedLock critical settings to prevent accidental changes:
# Lock the Rust version
ferrous-forge config lock required_rust_version --reason="Team decision to stay on 1.88"
# Try to change it (blocked!)
# Editing Cargo.toml to change rust-version will fail validation
# Unlock with justification
ferrous-forge config unlock required_rust_version --reason="Security patch requires 1.89"
# View all locks
ferrous-forge config lock-statusMandatory blocking hooks that prevent bad code:
# Install blocking hooks
ferrous-forge safety install
# Now git commit runs validation and blocks if failed
git commit -m "feat: add feature" # Blocked if violations exist!
# Emergency bypass (requires reason)
ferrous-forge safety bypass --stage=pre-commit --reason="WIP commit, will fix later"
# View audit log
ferrous-forge safety auditComplete rustup integration:
# Check current version and available updates
ferrous-forge rust check
# List recent releases
ferrous-forge rust list
# Install specific toolchain
ferrous-forge rust install-toolchain nightly
# Switch default toolchain
ferrous-forge rust switch stable
# Update all toolchains
ferrous-forge rust updateMigrate between Rust editions:
# Check edition compliance
ferrous-forge edition check
# Analyze before migrating
ferrous-forge edition analyze
# Migrate to Edition 2024
ferrous-forge edition migrate7 built-in templates with Forge standards pre-configured:
# List available templates
ferrous-forge template list
# Create from template
ferrous-forge template create my-cli --template=cli-app
ferrous-forge template create my-lib --template=library
ferrous-forge template create my-wasm --template=wasm
ferrous-forge template create my-embedded --template=embedded| Command | Description |
|---|---|
ferrous-forge init [--project] |
Initialize system or project |
ferrous-forge status |
Show installation status |
ferrous-forge validate [path] |
Validate project against standards |
ferrous-forge fix [path] |
Auto-fix code violations |
| Command | Description |
|---|---|
ferrous-forge config list |
Show all configuration |
ferrous-forge config set key=value |
Set configuration value |
ferrous-forge config lock <key> |
Lock a configuration value |
ferrous-forge config unlock <key> |
Unlock a configuration value |
ferrous-forge config lock-status |
Show lock status |
ferrous-forge config lock-audit |
View lock audit log |
ferrous-forge config export |
Export config for sharing |
ferrous-forge config import |
Import shared config |
| Command | Description |
|---|---|
ferrous-forge safety status |
Check pipeline status |
ferrous-forge safety install |
Install blocking git hooks |
ferrous-forge safety uninstall |
Remove git hooks |
ferrous-forge safety bypass |
Create emergency bypass |
ferrous-forge safety audit |
View bypass audit log |
ferrous-forge safety report |
View safety reports |
ferrous-forge safety stats |
Display safety statistics |
| Command | Description |
|---|---|
ferrous-forge rust check |
Check version and updates |
ferrous-forge rust list |
List recent releases |
ferrous-forge rust update |
Update toolchains |
ferrous-forge rust install-toolchain <channel> |
Install toolchain |
ferrous-forge rust switch <channel> |
Switch default toolchain |
Ferrous Forge uses hierarchical configuration (System β User β Project):
# ~/.config/ferrous-forge/config.toml (User level)
[validation]
max_file_lines = 500
max_function_lines = 100
required_edition = "2024"
ban_underscore_bandaid = true- System (
/etc/ferrous-forge/config.toml) β Organization-wide defaults - User (
~/.config/ferrous-forge/config.toml) β Personal preferences - Project (
./.ferrous-forge/config.toml) β Team-agreed standards Later levels override earlier levels. Project config has highest priority.
- Edition 2024 β Latest Rust edition enforced
- Zero Underscore Bandaid β No
_unusedparameters - No unwrap/expect β Proper error handling required
- No panic/todo/unimplemented β Production-ready code
- File size limits β 500 lines max per file
- Function size limits β 100 lines max per function
- Documentation β Public APIs require RustDoc
- Clippy β All, pedantic, and nursery lints enabled
When you run ferrous-forge safety install:
Pre-commit hook:
- β
Code formatting (
cargo fmt) - β Clippy validation
- β Ferrous Forge validation Pre-push hook:
- β All pre-commit checks
- β
Test suite (
cargo test) - β
Security audit (
cargo audit) Both hooks: - Check for active bypasses before blocking
- Provide clear error messages
- Require explicit bypass with reason
cargo install ferrous-forge# Homebrew (macOS/Linux)
brew install ferrous-forge
# Arch Linux (AUR)
yay -S ferrous-forge
# Nix
nix-env -iA ferrous-forge
# Windows (Chocolatey)
choco install ferrous-forgecargo new my-project
cd my-project
ferrous-forge init --projectThis creates:
.ferrous-forge/config.tomlβ Project configurationrustfmt.tomlβ Formatting rulesclippy.tomlβ Lint configuration.git/hooks/pre-commitβ Blocking pre-commit hook.git/hooks/pre-pushβ Blocking pre-push hook.vscode/settings.jsonβ IDE integration.github/workflows/ci.ymlβ CI/CD template
cd existing-project
ferrous-forge init --project
ferrous-forge fix # Auto-fix what can be fixedThese will cause validation to fail:
// β Underscore bandaid
fn bad_function(_unused: String) {}
// β Ignored results
let _ = some_result;
// β Unwrap in production
some_value.unwrap();
// β Wrong edition
edition = "2021" // Should be "2024"
// β Too many lines
fn huge_function() { // 100+ lines
// ...
}- No unsafe code β Ferrous Forge itself is 100% safe Rust
- Sandboxed execution β No elevated privileges required
- Dependency scanning β Automatic vulnerability detection
- Audit logging β All bypasses logged with timestamp and reason
- VISION.md β Core vision and philosophy
- ROADMAP.md β Implementation roadmap
- FEATURES.md β Detailed feature status
βββββββββββββββββββββββββββββββββββββββββββ
β Configuration Layers β
βββββββββββββββββββββββββββββββββββββββββββ€
β System β User β Project (merge order) β
βββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββ
β Safety Pipeline β
βββββββββββββββββββββββββββββββββββββββββββ€
β Pre-commit: Format β Clippy β Validate β
β Pre-push: Tests β Audit β Validate β
βββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββ
β Toolchain Management β
βββββββββββββββββββββββββββββββββββββββββββ€
β Rustup integration, edition management β
β GitHub API for release tracking β
βββββββββββββββββββββββββββββββββββββββββββ
We welcome contributions! See CONTRIBUTING.md for guidelines. Priority Areas:
- Custom lint rules (Dylint integration)
- IDE plugins (IntelliJ, Vim)
- Documentation improvements
- Bug fixes
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT License (LICENSE-MIT) at your option.
Hey there, fellow Rustaceans! π This is my very first Rust crate. After months of teaching myself Rust, I've built something I hope you'll find useful. This tool was born from frustration with inconsistent code standards and LLM agents working around lint rules. I'm super excited to learn and grow with the Rust community! π¦β¨
- π€ Think this tool is useful? Please let me know!
- π Think this is a stupid tool with no real need? Tell me that too!
- π Have ideas for improvements? I'm all ears! Thank you for taking the time to look at my work! π
Forge better Rust, automatically. π¨ β Star us on GitHub β’ π¦ Install from Crates.io β’ π Read the Docs