A tool that statically analyzes whether or not it complies with Ruby's coding standards. It parses all the code written in the .rb file and outputs the indent, method name, etc. to the terminal.
Add the following to the Gemfile.
gem 'rubocop', require: false
Installation
$ bundle install
https://docs.rubocop.org/rubocop/1.7/usage/basic_usage.html
$ rubocop
#Analyze and output the result to the terminal
$ rubocop -a
#or
$ rubocop --auto-correct
#Analyze and automatically correct
Describe the settings in .rubocop.yml. (My settings)
.rubocop.yml
AllCops:
inherit_from: .rubocop_todo.yml
AllCops:
Exclude:
- bin/*
- config/**/*
- db/schema.rb
- vendor/**/*
- Gemfile
NewCops: enable
Style/Documentation:
Enabled: false
Style/EmptyMethod:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: false