Role models are important.
-- Officer Alex J. Murphy / RoboCop
RuboCop is a Ruby static code analyzer. Out of the box it will enforce many of the guidelines outlined in the community Ruby Style Guide.
Most aspects of its behavior can be tweaked via various configuration options.
Apart from reporting problems in your code, RuboCop can also automatically fix some of the problems for you.
RuboCop's installation is pretty standard:
$ gem install rubocop
If you'd rather install RuboCop using
bundler, don't require it in your
gem 'rubocop', require: false
RuboCop's development is moving at a very rapid pace and there are
often backward-incompatible changes between minor releases (since we
haven't reached version 1.0 yet). To prevent an unwanted RuboCop update you
might want to use a conservative version locking in your
gem 'rubocop', '~> 0.41.0', require: false
rubocop in a Ruby project's folder and watch the magic happen.
$ cd my/cool/ruby/project $ rubocop
You can read a ton more about RuboCop in its official manual.
RuboCop supports the following Ruby implementations:
- MRI 1.9.3
- MRI 2.0
- MRI 2.1
- MRI 2.2
- MRI 2.3
- JRuby in 1.9 mode
- Rubinius 2.0+
Here's a list of RuboCop's core developers:
The logo is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
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 top priority right now. Writing a new cop is a great way to dive into RuboCop!
Of course, bug reports and suggestions for improvements are always welcome. GitHub pull requests are even better! :-)
RuboCop's changelog is available here.
Copyright (c) 2012-2016 Bozhidar Batsov. See LICENSE.txt for further details.