On this page
Overview
A static analyzer and formatter for Ruby. It checks source files against rules derived from the Ruby Style Guide, reports offenses, and can correct many of them. Configuration files and editor integration let teams use the same rules in local development and CI.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Report style violations and likely bugs with file-level context
Running rubocop at a project root recursively inspects eligible Ruby files and reports the line, column, severity, cop name, and explanation for each offense. Its lint rules can flag suspicious code as well as style inconsistencies.
Sources: [1]
Choose configuration and correction behavior deliberately
Teams can tune rules in .rubocop.yml, apply only safe corrections with -a, or include corrections that are not guaranteed safe with -A. Version 1.91.0 also adds --changed for Git-reported changed files and --diff for previewing corrections without writing them.
The built-in LSP server provides feedback in compatible editors. Rails, RSpec, and Performance cops are separate gems, so projects install only the extensions they need.
Best fit
Before adoption
Confirm Ruby compatibility, configuration changes, and autocorrect diffs
Version 1.91.0 runs on MRI 2.7 or later and JRuby 9.4 or later, while analyzing Ruby 2.0 or later. The project aims for stability across minor releases, but upgrades still require a review of configuration changes and newly introduced cops; pin the gem version appropriately.
-A includes corrections that are not guaranteed safe. Save the current work in version control and review the diff and tests after using it. The software is MIT-licensed, while the project logo is documented under a separate license.
Official sources
- [1]RuboCop v1.91.0 README(2026-10-04)
- [2]RuboCop v1.91.0 release notes(2026-10-04)
- [3]RuboCop v1.91.0 gem specification(2026-10-04)
- [4]RuboCop v1.91.0 MIT license(2026-10-04)
- [5]RuboCop GitHub repository metadata(2026-10-04)
Supplemental curator note
For an established codebase, start with changed files or a generated TODO baseline instead of fixing every historical offense at once. Review diffs and tests after any autocorrection, especially with -A.
Try it in 3 steps
- 1
Add the pinned version in a demo directory
Requires Ruby 2.7 or later and Bundler. This pins v1.91.0 in a local Gemfile.
mkdir rubocop-demo && cd rubocop-demo && bundle init && bundle add rubocop --version 1.91.0 - 2
Create a Ruby file with an offense
Create a minimal file in the same directory so the formatter has an offense to report.
printf '%s\n' 'x = 1' > sample.rb - 3
Inspect the file
Review the reported line, column, and cop name. The command may exit with status 1 because the sample intentionally contains an offense.
bundle exec rubocop sample.rb
Growth
Growth trends · Last 30 days
12,911 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 344
- Open PRs
- 60
Development activity is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- ruby
- rubocop
- linter
- static-code-analysis
- code-formatter
- hacktoberfest
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- fastlane42,201 Stars
1 shared tag(s) · 1 shared category(s) · Same language
automate repeatable iOS and Android build, signing, screenshot, and store-release workflows as lanes
Ruby - Vagrant27,211 Stars
1 shared tag(s) · 1 shared category(s) · Same language
define portable development environments across providers with a Vagrantfile
Ruby - Kamal14,628 Stars
1 shared tag(s) · 1 shared category(s) · Same language
deploy Dockerized web apps to bare metal or cloud VMs over SSH and switch traffic with kamal-proxy for zero-downtime releases
Ruby - Kaminari8,667 Stars
1 shared tag(s) · 1 shared category(s) · Same language
Add pagination to Ruby web apps with chainable scopes and rendering helpers
Ruby - Bullet7,337 Stars
1 shared tag(s) · 1 shared category(s) · Same language
detect ActiveRecord and Mongoid N+1 queries, unused eager loading, and counter-cache opportunities during development
Ruby - dotenv6,764 Stars
1 shared tag(s) · 1 shared category(s) · Same language
load
Ruby.envvalues into RubyENVand keep development and test configuration out of application source code
Report incorrect information
Tell us if any listing information is incorrect or outdated.