Last Updated: May 15, 2019
·
933
· bbatsov

Use RuboCop to check Ruby code style

RuboCop is a Ruby code style checker based on the
Ruby Style Guide.

Installation

RuboCop's installation is pretty standard:
$ gem install rubocop

Basic Usage

Running rubocop with no arguments will check all Ruby source files
in the current folder:
$ rubocop
Alternatively you can pass rubocop a list of files and folders to check:
$ rubocop app spec lib/something.rb
For more details check RuboCop's GitHub project.