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)

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay