LoginSignup
0
0

More than 1 year has passed since last update.

【Rails】RuboCopの導入

Posted at

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
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0