Skip to content

Add Sorbet sigils to every file in lib/ - #5787

Merged
rmosolgo merged 2 commits into
masterfrom
claude/sorbet-coverage-plan-3acc4a
Oct 17, 2026
Merged

rmosolgo merged 2 commits into
masterfrom
claude/sorbet-coverage-plan-3acc4a

Conversation

@rmosolgo

@rmosolgo rmosolgo commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Expands Sorbet coverage beyond lib/graphql.rb by giving every file in lib/ an explicit sigil.

What changed

  • # typed: true on 182 files. Each of these already passed srb tc --typed=true with no code changes.
  • # typed: false on the 150 files that still have errors at true (about 1,100 errors in total). These were already effectively false; the sigil just says so, so each one can be moved up later.
  • # typed: ignore on the 44 files that sorbet/config already --ignores (generators, dashboard and the optional tracing integrations). sorbet/config is unchanged.
  • Sorbet/HasSigil from rubocop-sorbet, enabled for lib/**/*.rb. rubocop-sorbet is added as a development dependency next to rubocop in 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, matching lib/graphql.rb. The only change to lib/ is that added comment line.

Verification

  • BUNDLE_GEMFILE=gemfiles/sorbet.gemfile bundle exec srb tc: no errors
  • bundle exec rake rubocop: no offenses. This passes under both the default Gemfile and gemfiles/sorbet.gemfile, and I checked that the cop flags a file with no sigil.
  • Spot-checked specs (backtrace, schema, execution errors, fields_will_merge) all pass. No spec asserts on line numbers inside lib/.

For reviewers

  • lib/graphql/static_validation/rules/fields_will_merge.rb starts 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.
  • Suggested next steps: fix the false files 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

rmosolgo and others added 2 commits October 16, 2026 09:49
- `# 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>
@rmosolgo
rmosolgo merged commit 84e16f5 into master Oct 17, 2026
15 of 16 checks passed
@rmosolgo
rmosolgo deleted the claude/sorbet-coverage-plan-3acc4a branch October 17, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant