RuboCop¶
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.
https://github.com/bbatsov/rubocop#rubocop
Configuring RuboCop¶
If you have a .rubocop.yml
in your repository, you can configure RuboCop by adding the following lines to your configuration:
build:
nodes:
analysis:
tests:
override:
- rubocop-run
rubocop-run
is a built-in wrapper for RuboCop which takes care of results and output format, however all the options of RuboCop are supported as well. For example:
rubocop-run --config <config>
Custom Installation¶
If you want to use a specific version of RuboCop, you can add them to your Gemfile
as you need them:
gem 'rubocop', '<version>'