RuboCop
$ rubocop Community Low RiskThe standard Ruby and Rails static analyzer, linter, and code formatter enforcing community style, lint, security, and metrics cops. Emits structured --format json reports and distinguishes safe --autocorrect (-a) from aggressive --autocorrect-all (-A).
brew install rubocop Analyzes and formats local Ruby files directly; CLI execution is standard and fast with --server.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --format json, --no-color, --only cop filtering, --fail-level, and --server daemon acceleration.
--format jsonemits clean JSON payloads--onlyand--exceptfilter cops precisely
Read-only by default and separates safe --autocorrect from unsafe --autocorrect-all, though lacks a dry-run diff mode.
- Safe
-avs unsafe-Aautocorrection boundary
Installable via Homebrew or gem install rubocop / Bundler, requiring a Ruby runtime.
- Requires Ruby runtime and project
Gemfileplugins (e.g.rubocop-rails)
Unifies Ruby linting and formatting with rich Rails/RSpec extensions and --server caching.
- Covers style, lint, security, and metrics in one CLI
Standard Ruby ecosystem tool (rubocop/rubocop) actively maintained under MIT license.
- Canonical
rubocop/rubocoprepository
Well-structured Antora documentation covering CLI options and every cop.
- Official docs at docs.rubocop.org
Security, Auth & Guardrails
Offline local Ruby static analyzer; no credentials stored or required.
MIT open-source Ruby gem/CLI; completely free.
# RuboCop (rubocop) Agent Rules - Always pass `--format json --no-color` when inspecting Ruby offenses. - Prefer `--autocorrect` (`-a`) over `--autocorrect-all` (`-A`), which can rewrite semantics.
Agent-Ready Command Recipes
Safe Read-Only Queries
rubocop --format json --no-color
Outputs complete per-file offenses, line/column locations, cop names, and severity in JSON.
Controlled Writes & Previews
rubocop --autocorrect --format json app/
Applies only safe autocorrections (-a) to app/ and outputs remaining offenses as JSON.
Strengths for Agents
- + Built-in
--format json --no-colorreturns structured cop names, severities, and exact spans. - + Separates safe
--autocorrect(-a) from potentially unsafe--autocorrect-all(-A).
Caveats & Pitfalls
- ! Projects using
rubocop-railsorrubocop-rspecshould run viabundle exec rubocoprather than global binary. - ! No
--dry-rundiff preview flag before-awrites files.