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

Reduce size of rubocop.rbi #19146

Open
1 task done
dduugg opened this issue Jan 24, 2025 · 0 comments
Open
1 task done

Reduce size of rubocop.rbi #19146

dduugg opened this issue Jan 24, 2025 · 0 comments
Labels
features New features

Comments

@dduugg
Copy link
Member

dduugg commented Jan 24, 2025

Verification

Provide a detailed description of the proposed feature

The tapioca-generated rubocop.rbi file is currently 60k lines / 1.69 MB, which is over 10% of the LoC in the repo (using the output of git ls-files -z | xargs -0 cat | wc -l as a base), and growing with each rubocop release.

The bloat is mostly because each cop is represented as a class, along with the methods it implements. We likely only need a few files for typechecking, such as https://github.com/rubocop/rubocop/blob/master/lib/rubocop/cop/base.rb and cops that we extend (e.g. MutableConstant)

We have some existing code that overrides what we require when generating tapioca definitions, let's try overriding the default behavior to limit what we load when creating the rubocop rbi file.

What is the motivation for the feature?

This file is currently the ceiling on what we allow to be pushed to the repo. By resolving this issue, we should be able to reduce the limit back to 1MB or lower (unless something else sneaks in while we have the higher limit).

How will the feature be relevant to at least 90% of Homebrew users?

Possibly, a less bloated git history, resulting in marginally better performance in some workflows.

What alternatives to the feature have been considered?

We could just keep nudging up the push limit as rubocop.rbi grows.

@dduugg dduugg added the features New features label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
features New features
Projects
None yet
Development

No branches or pull requests

1 participant