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以下になったときに簡単に気づける。

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

AWS GenAI LIVE!

GenAI LIVE! is a dynamic live-streamed show exploring how AWS and our partners are helping organizations unlock real value with generative AI.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️