Gemのインストール
RuboCopをGemfileに追加し、インストールします。
group :development do
gem 'rubocop', require: false
gem "rubocop-performance", require: false
gem "rubocop-rails", require: false
gem "rubocop-rspec", require: false
end
ターミナル
$ bundle install
設定ファイルの作成
.rubocop.yml
を作成します。
.rubocop.yml
inherit_from: .rubocop_todo.yml
require:
- rubocop-performance
- rubocop-rails
- rubocop-rspec
AllCops:
NewCops: enable
以下のコマンドで.rubocop_todo.yml
を作成します。
ターミナル
$ rubocop --auto-gen-config