Integrating Ferrous Forge with IDEs, CI/CD, and development workflows.
Add to .vscode/settings.json:
{
"rust-analyzer.checkOnSave.command": "clippy",
"rust-analyzer.checkOnSave.extraArgs": ["--all-targets", "--all-features"],
"editor.formatOnSave": true,
"[rust]": {
"editor.defaultFormatter": "rust-lang.rust-analyzer"
}
}Create .vscode/tasks.json:
{
"version": "2.0.0",
"tasks": [
{
"label": "Ferrous Forge Validate",
"type": "shell",
"command": "ferrous-forge",
"args": ["validate"],
"group": {
"kind": "test",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": "$rustc"
}
]
}Coming Soon: VS Code extension with real-time validation
- Go to Settings → Tools → External Tools
- Click + to add a new tool
- Configure:
- Name: Ferrous Forge Validate
- Program:
ferrous-forge - Arguments:
validate $ProjectFileDir$ - Working directory:
$ProjectFileDir$
- Add keyboard shortcut in Settings → Keymap
Add to .vimrc or init.vim:
" Add Ferrous Forge as a linter
let g:ale_linters = {
\ 'rust': ['cargo', 'clippy'],
\}
" Run Ferrous Forge manually
nnoremap <leader>ff :!ferrous-forge validate --quiet<CR>-- Run Ferrous Forge on save
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = "*.rs",
callback = function()
vim.fn.system('ferrous-forge validate --quiet')
end
})Create .github/workflows/ferrous-forge.yml:
name: Ferrous Forge Validation
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Install Ferrous Forge
run: cargo install ferrous-forge
- name: Run Ferrous Forge Validation
run: ferrous-forge validateAdd to .gitlab-ci.yml:
ferrous-forge:
stage: test
image: rust:latest
before_script:
- cargo install ferrous-forge
script:
- ferrous-forge validate
cache:
paths:
- target/
- .cargo/Create Jenkinsfile:
pipeline {
agent any
stages {
stage('Setup') {
steps {
sh 'cargo install ferrous-forge'
}
}
stage('Validate') {
steps {
sh 'ferrous-forge validate'
}
}
}
}Add to .circleci/config.yml:
version: 2.1
jobs:
ferrous-forge:
docker:
- image: rust:latest
steps:
- checkout
- run:
name: Install Ferrous Forge
command: cargo install ferrous-forge
- run:
name: Validate Code
command: ferrous-forge validate
workflows:
version: 2
validate:
jobs:
- ferrous-forgeAdd to .cargo/config.toml:
[alias]
# Add Ferrous Forge aliases
ff-validate = "run --bin ferrous-forge -- validate"
ff-check = "run --bin ferrous-forge -- validate --quiet"
ff-fix = "run --bin ferrous-forge -- fix"Create Makefile:
.PHONY: validate build test
validate:
@ferrous-forge validate
build: validate
@cargo build --release
test: validate
@cargo test
check: validate test
@echo "✅ All checks passed!"Ferrous Forge installs git hooks automatically when you run:
ferrous-forge init --project
# or
ferrous-forge safety installThe hooks validate:
- Code formatting (
cargo fmt) - Linting (
cargo clippy) - Ferrous Forge standards
Create .pre-commit-config.yaml:
repos:
- repo: local
hooks:
- id: ferrous-forge
name: Ferrous Forge Validation
entry: ferrous-forge validate
language: system
files: '\.rs$'
pass_filenames: falseInstall:
pip install pre-commit
pre-commit installAdd to ~/.bashrc or ~/.zshrc:
# Ferrous Forge aliases
alias ffv='ferrous-forge validate'
alias ffc='ferrous-forge fix'
alias ffs='ferrous-forge safety check'
alias fft='ferrous-forge template list'
# Quick validation function
ff() {
ferrous-forge validate "$@" && echo "✅ Validation passed!"
}Add to ~/.config/fish/config.fish:
# Ferrous Forge abbreviations
abbr ffv 'ferrous-forge validate'
abbr ffc 'ferrous-forge fix'
abbr ffs 'ferrous-forge safety check'
function ff
ferrous-forge validate $argv; and echo "✅ Validation passed!"
endEnsure ~/.cargo/bin is in your PATH:
# Check PATH
echo $PATH | grep ".cargo/bin"
# Add if missing
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.bashrc
source ~/.bashrcUse --quiet for faster execution:
- run: ferrous-forge validate --quietSkip hooks in emergencies:
git commit --no-verifyPlanned for v2.0:
- VS Code extension with real-time validation
- IntelliJ plugin
- Language Server Protocol (LSP) support
- REST API for validation