Skip to content

Skip RBS rewrite when no markers are present#2616

Draft
mattkubej wants to merge 1 commit intomainfrom
rbs-marker-guard
Draft

Skip RBS rewrite when no markers are present#2616
mattkubej wants to merge 1 commit intomainfrom
rbs-marker-guard

Conversation

@mattkubej
Copy link
Copy Markdown

@mattkubej mattkubej commented May 7, 2026

Summary

Avoid running Spoom's RBS-to-Sorbet-sig translator for typed Ruby files that cannot contain runtime-rewriteable RBS syntax.

Tapioca currently calls Spoom::Sorbet::Translate.rbs_comments_to_sorbet_sigs for every typed Ruby file loaded through the RBS rewriter. A large portion of typed files in Core do not contain RBS signatures or supported RBS annotations, so the translator often parses source only to return it unchanged.

This keeps the existing typed: gate and adds a conservative marker gate. Translation now runs only when source contains one of:

  • #:
  • #|
  • # @abstract
  • # @interface
  • # @sealed
  • # @final
  • # @requires_ancestor:
  • # @override
  • # @overridable
  • # @without_runtime

False positives are safe because they still use the existing translator. False negatives would be unsafe, so the annotation list is intentionally aligned with Spoom's currently supported runtime-rewrite annotations.

@mattkubej mattkubej force-pushed the rbs-marker-guard branch from c06244a to 3ad4466 Compare May 7, 2026 23:24
@mattkubej mattkubej added the enhancement New feature or request label May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant