RuboCop is a Ruby static code analyzer (a.k.a. linter) and code formatter. Created by Bozhidar Batsov, RuboCop is configured out of the box to enforce many of the guidelines outlined in the community-driven Ruby Style Guide.
Most aspects of its behavior are configurable via a .rubocop.yml file, and the tool can also automatically fix many of the issues it identifies. RuboCop is a near-universal dependency in modern Ruby codebases.
Ruby static code analyzer and formatter. Enforces the community style guide automatically.
✨ Features
Hundreds of cops enforcing layout, naming, syntax, lint, and security best practices.
Many violations fixable automatically. Run rubocop -a and watch the codebase tidy itself.
.rubocop.yml customizes every cop. Inherit from gems, override per directory, exclude legacy.
rubocop-performance detects slow Ruby patterns and suggests faster alternatives.
Catch dangerous Ruby idioms — open redirects, command injection, unsafe yaml, eval misuse.