Rubocop

RuboCop is a Ruby code style checking and code formatting tool.

It aims to enforce the community-driven Ruby Style Guide.


.rubocop.yml


<%= File.read('.rubocop.yml') %>


controllers/home_controller.rb


<%= File.read('app/controllers/home_controller.rb') %>


Call rubocop variations


# uses .rubocop.yml and any hierarchy configs
rubocop

# uses .rubocop.yml only
rubocop --config .rubocop.yml

# uses will AutoCorrect offenses
rubocop -A --config .rubocop.yml


<%= image_tag 'cop-output' %>