Repository navigation
Add Sorbet sigils to every file in lib/ - #5787
Merged
Merged
Conversation
- `# typed: true` for the 182 files that already typecheck cleanly - `# typed: false` for the 150 files that still have errors at `true` - `# typed: ignore` for the 44 files that sorbet/config already ignores Add Development/SorbetSigilCop so new files in lib/ must declare a sigil. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add rubocop-sorbet as a development dependency next to rubocop and replace Development/SorbetSigilCop with the built-in Sorbet/HasSigil, which also autocorrects by inserting `# typed: false`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expands Sorbet coverage beyond
lib/graphql.rbby giving every file inlib/an explicit sigil.What changed
# typed: trueon 182 files. Each of these already passedsrb tc --typed=truewith no code changes.# typed: falseon the 150 files that still have errors attrue(about 1,100 errors in total). These were already effectivelyfalse; the sigil just says so, so each one can be moved up later.# typed: ignoreon the 44 files thatsorbet/configalready--ignores (generators, dashboard and the optional tracing integrations).sorbet/configis unchanged.Sorbet/HasSigilfrom rubocop-sorbet, enabled forlib/**/*.rb. rubocop-sorbet is added as a development dependency next torubocopin the gemspec. The cop flags any file without a# typed:sigil and can autocorrect by inserting# typed: false.Each sigil goes on line 2, right after
# frozen_string_literal: true, matchinglib/graphql.rb. The only change tolib/is that added comment line.Verification
BUNDLE_GEMFILE=gemfiles/sorbet.gemfile bundle exec srb tc: no errorsbundle exec rake rubocop: no offenses. This passes under both the default Gemfile andgemfiles/sorbet.gemfile, and I checked that the cop flags a file with no sigil.lib/.For reviewers
lib/graphql/static_validation/rules/fields_will_merge.rbstarts with# frozen_string_literal: true(note the leading space), so the magic comment isn't active in that file. I left it alone because fixing it would change runtime behavior.falsefiles that have 1–2 errors (57 of them). After that, tackle the common error patterns: modules that call methods from the class they're mixed into (context,add_error) and lazily initialized nilable ivars.🤖 Generated with Claude Code