OSS TanbouSign in with GitHub

Check Ruby code for style violations and likely bugs, with optional corrections

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
12,911
Primary language
Ruby
License
MIT
Repository last updated
Oct 3, 2026
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.

Sources: [1][2]

Best fit

Introduce a shared Ruby quality baseline incrementally

It fits teams that want the same checks in an editor, a local command, and CI. Repositories with a large existing offense count can start with changed files or generate a TODO configuration, then tighten the baseline over time.

Sources: [1][2]

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.

Sources: [1][3][4]

Official sources

  1. [1]RuboCop v1.91.0 README(2026-10-04)
  2. [2]RuboCop v1.91.0 release notes(2026-10-04)
  3. [3]RuboCop v1.91.0 gem specification(2026-10-04)
  4. [4]RuboCop v1.91.0 MIT license(2026-10-04)
  5. [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. 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. 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. 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
Check the official README

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
Stars
12,911
Forks
3,147
Watchers
171
Open issues
94
Contributors
399
Owner type
Organization
Primary language
Ruby
License
MIT
Repository last updated
Oct 3, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?