Skip to content

RBS: Update signatures of lex_file and parse_file - #1990

Open
domingo2000 wants to merge 1 commit into
marcoroth:mainfrom
domingo2000:fix/fix-rbs-signature-for-lext-file-and-parse-file
Open

RBS: Update signatures of lex_file and parse_file#1990
domingo2000 wants to merge 1 commit into
marcoroth:mainfrom
domingo2000:fix/fix-rbs-signature-for-lext-file-and-parse-file

Conversation

@domingo2000

@domingo2000 domingo2000 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Fixes #1989

With his we prevent having issues with tapioca
rbi generation because of the invalid
RBS for this method omitting the ** argument

@github-actions github-actions Bot added ruby Ruby source for the gem and its libraries rubygem The herb RubyGem and its packaging labels Aug 4, 2026
@domingo2000

Copy link
Copy Markdown
Contributor Author

@marcoroth feel free to edit the PR in any way you need. Just left here the fix that will fix our RBI tapioca generation that I tested in my local branch.

Here is an image before and after applying the fix locally:

image

With his we prevent having issues with tapioca
rbi generation because of the invalid
RBS for this method omitting the ** argument
@domingo2000
domingo2000 force-pushed the fix/fix-rbs-signature-for-lext-file-and-parse-file branch from 1ed8fdb to 1ccce8a Compare August 4, 2026 05:19
@github-actions github-actions Bot added the rbs RBS type signatures in sig/ label Aug 4, 2026
@marcoroth marcoroth changed the title Linter CLI: fix RBS signatures of lex_file and parse_file Ruby: Update RBS signatures of lex_file and parse_file Aug 4, 2026
@marcoroth marcoroth changed the title Ruby: Update RBS signatures of lex_file and parse_file RBS: Update signatures of lex_file and parse_file Aug 4, 2026
Comment thread lib/herb.rb
module Herb
class << self
#: (String path, ?arena_stats: bool) -> LexResult
#: (String path, ?arena_stats: bool, **untyped) -> LexResult

@marcoroth marcoroth Aug 4, 2026

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

As mentioned in #1989 (comment), we probably want to remove the **untyped and enumerate all kwargs again in the actual method declaration:

#: (String path, ?arena_stats: bool) -> LexResult
def lex_file(path, arena_stats: nil)
  lex(File.read(path), arena_stats:)
end

I wish there was a way around this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rbs RBS type signatures in sig/ ruby Ruby source for the gem and its libraries rubygem The herb RubyGem and its packaging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RBS: Error using tapioca gem on herb because of malformed RBS on lex_file and parse_file

2 participants