rubocop /rubocop

A Ruby static code analyzer and formatter, based on the community Ruby style guide.

★ 12,916⑂ 3,163👁 169⑃ 8,593● 6,273▤ 294
RubyCreated 2012-04-21rubocop.org
12,916
stars
+0+-2+4
3,163
forks
169
watchers
8,593
prs
6,273
issues
294
releases
–
discussions

README

----------





 Role models are important. 
 -- Officer Alex J. Murphy / RoboCop

RuboCop is a Ruby static code analyzer (a.k.a. linter) and code formatter. Out of the box it
will enforce many of the guidelines outlined in the community Ruby Style
Guide. Apart from reporting the problems discovered in your code,
RuboCop can also automatically fix many of them for you.

RuboCop is extremely flexible and most aspects of its behavior can be tweaked via various
configuration options.

----------





Working on RuboCop is often fun, but it also requires a great deal of time and energy.

Please consider financially supporting its ongoing development.

 Installation

RuboCop's installation is pretty standard:

sh
gem install rubocop


If you'd rather install RuboCop using bundler, add a line for it in your
Gemfile (but set the require option to false, as it is a standalone tool):

rb
gem 'rubocop', require: false


RuboCop is stable between minor versions, both in terms of API and cop configuration.
We aim to ease the maintenance of RuboCop extensions and the upgrades between RuboCop
releases. All big changes are reserved for major releases.
To prevent an unwanted RuboCop update you might want to use a conservative version lock
in your Gemfile:

rb
gem 'rubocop', '~ 1.92', require: false


See our versioning policy for further details.

 Quickstart

Just type rubocop in a Ruby project's folder and watch the magic happen.

sh
cd my/cool/ruby/project
rubocop


 [!TIP]

 You can also use this magic in your favorite editor with RuboCop's
 built-in LSP server.

 Documentation

You can read a lot more about RuboCop in its official docs.

 Compatibility

RuboCop officially supports the following runtime Ruby implementations:

 MRI 2.7+
 JRuby 9.4+

It targets Ruby 2.0+ for code analysis.

See the compatibility documentation for further details.

 Readme Badge

If you use RuboCop in your project, you can include one of these badges in your readme to let people know that your code is written following the community Ruby Style Guide.





Here are the Markdown snippets for the two badges:

 markdown





 Team

Here's a list of RuboCop's core developers:

 Bozhidar Batsov (author & head maintainer)
 Jonas Arvidsson
 Yuji Nakayama (retired)
 Evgeni Dzhelyov (retired)
 Ted Johansson
 Masataka Kuwabara (retired)
 Koichi Ito
 Maxim Krizhanovski
 Benjamin Quorning
 Marc-André Lafortune
 Daniel Vandersluis

See the team page for more details.

 Logo

RuboCop's logo was created by Dimiter Petrov. You can find the logo in various
formats here.

The logo is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.

 Contributors

Here's a list of
all the people who have contributed to the development of RuboCop.

I'm extremely grateful to each and every one of them!

If you'd like to contribute to RuboCop, please take the time to go
through our short
contribution guidelines.

Converting more of the Ruby Style Guide into RuboCop cops is our t

Snapshot: 2026-11-04T14:00:00Z · Data license Apache-2.0 · JSON