Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert the utils/tty RBI generator to a Tapioca compiler #16899

Merged
merged 5 commits into from Mar 30, 2024

Conversation

issyl0
Copy link
Member

@issyl0 issyl0 commented Mar 16, 2024

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

  • The preferred way of doing RBI generation is via Tapioca. So I am trying to stop being intimidated by it, by learning how it works.
  • This is very WIP still, currently failing with the following message because the module name is missing in the generated RBI file.
There are parse errors in the generated RBI files.

Errors:
  sorbet/rbi/dsl/tty.rbi:8: unexpected token tNL (2001)
  sorbet/rbi/dsl/tty.rbi:64: unexpected token "end" (2001)

@issyl0
Copy link
Member Author

issyl0 commented Mar 16, 2024

/cc @dduugg since you offered 👀 on unsticking me!

@dduugg
Copy link
Sponsor Member

dduugg commented Mar 16, 2024

@issyl0 I pushed a teensy change, lmk if that unblocks you.

@issyl0
Copy link
Member Author

issyl0 commented Mar 17, 2024

Yes, that works (and I understand what I was doing wrong)! Thank you, @dduugg! ⭐

issyl0 and others added 4 commits March 29, 2024 00:41
- The preferred way of doing RBI generation is via Tapioca. So I am
  trying to stop being intimidated by it, by learning how it works.
- This is very WIP still, currently failing with the following message
  because the `module` name is missing in the generated RBI file.

```
There are parse errors in the generated RBI files.

Errors:
  sorbet/rbi/dsl/tty.rbi:8: unexpected token tNL (2001)
  sorbet/rbi/dsl/tty.rbi:64: unexpected token "end" (2001)
```
@issyl0 issyl0 force-pushed the tapioca-compiler-for-tty-rbi branch from 5c382bb to 67a096f Compare March 29, 2024 00:44
@issyl0
Copy link
Member Author

issyl0 commented Mar 29, 2024

I finally got back to this (sorry for the delay) and Sorbet now passes. 🎉

@issyl0 issyl0 marked this pull request as ready for review March 29, 2024 00:45
@issyl0 issyl0 requested a review from dduugg March 29, 2024 00:46
Copy link
Sponsor Member

@dduugg dduugg left a comment

Choose a reason for hiding this comment

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

Looking very nice! I left a few suggestions, though I know a lot of the logic is copy pasta'd from the previous version.

Library/Homebrew/sorbet/tapioca/compilers/tty.rb Outdated Show resolved Hide resolved
Library/Homebrew/sorbet/tapioca/compilers/tty.rb Outdated Show resolved Hide resolved
Library/Homebrew/sorbet/tapioca/compilers/tty.rb Outdated Show resolved Hide resolved
Library/Homebrew/sorbet/tapioca/compilers/tty.rb Outdated Show resolved Hide resolved
Library/Homebrew/sorbet/tapioca/compilers/tty.rb Outdated Show resolved Hide resolved
@issyl0 issyl0 force-pushed the tapioca-compiler-for-tty-rbi branch 2 times, most recently from 828e214 to 81eaeca Compare March 30, 2024 13:09
@issyl0 issyl0 requested a review from dduugg March 30, 2024 13:10
@issyl0
Copy link
Member Author

issyl0 commented Mar 30, 2024

Thanks @dduugg! Changes applied since they all made sense, a lot of it was copypasta from the previous version where I was trying to cover all bases that it turns out we didn't need to (like the boolean types, and some methods being dynamic and some not).

Copy link
Sponsor Member

@dduugg dduugg left a comment

Choose a reason for hiding this comment

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

Looks great! So tidy!

Library/Homebrew/sorbet/tapioca/compilers/tty.rb Outdated Show resolved Hide resolved
@issyl0 issyl0 force-pushed the tapioca-compiler-for-tty-rbi branch from 81eaeca to db39e93 Compare March 30, 2024 18:00
@issyl0 issyl0 enabled auto-merge March 30, 2024 18:01
@issyl0 issyl0 merged commit a3932b4 into master Mar 30, 2024
26 checks passed
@issyl0 issyl0 deleted the tapioca-compiler-for-tty-rbi branch March 30, 2024 18:10
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.

None yet

2 participants