-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Keep only the parts of rubocop.rbi
that we actually use
#20193
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
Conversation
f39d098
to
9a02120
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤩 Looks promising! I left some initial comments/questions. I'd also suggest moving the logic outside of typecheck.rb and (ofc) adding tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, though I do wonder if it's really worth adding 150 lines of code to maintain just to save a few hundred KB in an already autogenerated file? Can it be any simpler even if it makes the RBI a little bigger? No worries if not, just wanted to ask.
fcc37e7
to
52254ed
Compare
I tried, @Bo98. I tried making it a Tapioca compiler like we have prior art for rather than something just shoved on the end of |
- This file was _massive_ - over 60k lines and we had to bump the file size limit for pushes to the repo! - This was because by default Tapioca, when it encounters a `require "rubocop"` during RBI generation, loads all of the cops ever because they're all classes inside `RuboCop::Cop`. - There wasn't an easy way to control this at Tapioca generation time (we tried), so now we parse the generated RBI file and delete classes and method definitions that we don't use. - I regenerated the RBIs (`brew tc --update rubocop`) and added new things to the allowlist until Sorbet came back green. - Now the file is ~7k lines and 240K - much better!
52254ed
to
836d852
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good when working!
@issyl0 Is this ready to 🚢? |
It is - I was waiting for a follow-up review from the people who requested changes (and also distracted). |
@issyl0 woohoo great work! |
wat
|
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?require "rubocop"
during RBI generation, loads all of the cops ever because they're all classes insideRuboCop::Cop
.brew tc --update rubocop
) and added new things to the allowlist until Sorbet came back green.