Skip to content

Support per-gem documentation exclusions - #2688

Open
st0012 wants to merge 1 commit into
mainfrom
codex/gem-doc-exclusions
Open

Support per-gem documentation exclusions#2688
st0012 wants to merge 1 commit into
mainfrom
codex/gem-doc-exclusions

Conversation

@st0012

@st0012 st0012 commented Jul 30, 2026

Copy link
Copy Markdown
Member

Motivation

Some gems, such as Stripe, can generate 10–20 MB RBI files. Omitting their source comments can substantially reduce those files, while disabling documentation globally also removes useful comments from smaller gem RBIs.

Implementation

  • Allow gem.doc to accept an exclude list.
  • Generate RBIs normally for excluded gems while omitting their source comments.
  • Preserve the existing Boolean and command-line documentation options.
  • Document and validate the new configuration.

Tests

Added configuration-validation and end-to-end gem-generation coverage.

@st0012
st0012 requested a review from a team as a code owner July 30, 2026 18:01
@st0012 st0012 added the enhancement New feature or request label Jul 30, 2026
Comment thread lib/tapioca/cli.rb
file_header: options[:file_header],
include_doc: options[:doc],
include_doc: doc != false,
doc_exclude: doc_exclude,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like that this hash, true or false setup reads better in the config.yml but I wonder if it's confusing since this defaults to doc: true and exclude: foo. Wdyt?

gem:
  doc:
    exclude:
    - foo

Compared to having

gem:
  doc: true
  exclude_doc:
  - foo

Comment thread lib/tapioca/cli.rb
end

doc = options[:doc]
doc_exclude = doc.is_a?(Hash) ? doc.fetch("exclude", []) : []

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We have a --config flag which complicates things, imagine someone doing tapioca gem foo --doc --config sorbet/tapioca/config.yml and the config has exclude. In that case I think we should instead respect the exclude flag. We also need a test for this behaviour where they are used together.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants