Skip to content

Reduce size of rubocop.rbi #19146

@dduugg

Description

@dduugg

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.

Metadata

Metadata

Assignees

Labels

help wantedWe want help addressing this

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions