0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[Rails]RuboCopが遅いときにやること

Posted at

はじめに

AllCopsで対象外のファイルを指定したら急に動作が遅くなったRuboCopさんの動作速度を改善する方法。

原因

AllCopsで除外ファイルを指定する前は明らかな不要フォルダは検索してなかった。
除外ファイルを指定すると、指定ファイル以外は全部検索していた。

解決策

検索不要なフォルダを指定する。実際のやつはこんな感じ↓

.rubocop.yml
AllCops:
  TargetRubyVersion : 2.6
  Exclude:
    - 'db/schema.rb'
    - 'db/migrate/*'
    - !ruby/regexp /old_and_unused\.rb$/
    - 'bin/*'
    - 'node_modules/**/*'
    - 'config/**/*'
    - 'public/**/*'
    - 'tmp/**/*'
    - 'log/**/*'
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?