Skip to content

Expose RBS syntax and strictness helpers for rbs_rewriter - #1031

Merged
st0012 merged 1 commit into
mainfrom
codex/rbs-minimum-strictness
Oct 14, 2026
Merged

st0012 merged 1 commit into
mainfrom
codex/rbs-minimum-strictness

Conversation

@st0012

@st0012 st0012 commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

rbs_rewriter needs separate checks for the sigil level and RBS syntax so it can count each skip reason. This adds Sigils.satisfies_minimum_strictness?(content, strictness) and RBSCommentsToSorbetSigs.contains_rbs_syntax?(content).

The RBS helper matches comment markers so callers can skip parsing files without RBS annotations. It does not validate syntax or check the sigil. The rewrite pattern becomes private, and the generated RBI exposes the two predicates.

@st0012
st0012 force-pushed the codex/rbs-minimum-strictness branch from b199267 to a157ab3 Compare October 12, 2026 19:24
@st0012
st0012 marked this pull request as ready for review October 13, 2026 09:21
@st0012
st0012 requested a review from a team as a code owner October 13, 2026 09:21
"# @overridable",
"# @without_runtime",
]).freeze #: Regexp
private_constant :RBS_REWRITE_PATTERN

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you undoing #1030?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I didn't cut a release for it and this PR adopts @amomchilov's suggestion to create API methods instead.

@st0012
st0012 requested a review from Morriar October 13, 2026 21:19
@st0012
st0012 merged commit 3ea933d into main Oct 14, 2026
11 checks passed
@st0012
st0012 deleted the codex/rbs-minimum-strictness branch October 14, 2026 14:48
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.

2 participants