DEV Community

hiko1129
hiko1129

Posted on • Originally published at note.hiko1129.com on

[Rails][Sorbet] Rubocop Settings

Translate ja to en

下記のようにrubocop-sorbetが入っている前提

group :development, :test do
  gem 'rubocop-sorbet', require: false
end
Enter fullscreen mode Exit fullscreen mode

下記のようにTrueSigilを有効化してExcludeでspecやconfigを除外するのが良さげ。
デフォルトでFalseSigilが機能しているので全体としてはtyped: falseが必須でアプリケーション本体に関連する部分のみtyped: true以上必須という挙動になる。

Sorbet/TrueSigil:
  Enabled: true
  Include:
    - "**/*.{rb,rbi,rake,ru,jb,jbuilder}"
  Exclude:
    - spec/**/*
    - config/**/*
Enter fullscreen mode Exit fullscreen mode

上記設定があるとbundle exec srb rbi suggest-typedでアプリケーション関連のtypedがfalse以下になったときに簡単に気づける。

Latest comments (0)