tapioca icon indicating copy to clipboard operation
tapioca copied to clipboard

Allow disabling documentation generation for some gems

Open Morriar opened this issue 2 years ago • 2 comments

Some gems such as parser or rubocop are known to slowing down Tapioca RBI generation.

While we are thinking about an alternative way to generate the documentation for all gems, it would be nice if Tapioca offered a mechanism to disable documentation generation on a per-gem basis.

Maybe something like this in the configuration:

gem:
  doc: true
  doc-exclude:
  - parser
  - rubocop

Morriar avatar Jan 17 '23 17:01 Morriar

Bumping this, it would be great to have this available. Would it be reasonably low effort to implement?

marknuzz avatar Sep 17 '24 17:09 marknuzz

@marknuzz It'd be something like this

  1. Create an array CLI option called doc-exclude similar to exclude.
  2. That information gets passed to the pipeline which triggers the Yarddoc generation 1,2.
  3. Notice that Pipeline has access to the gem that is being generated, so before creating Gem::Listeners::YardDoc we should be able to check if gem.name is in the doc-exclude array.
  4. Add a test in pipeline spec with a similar setup to this. We could also have a cli test similar to this but I'm not sure it's worth it.

To test manually during development you can make edits and run bin/tapioca gem parser in this repo after changing sorbet/tapioca/config.yml. Or in another repo you can point your tapioca to your local clone in the Gemfile.

KaanOzkan avatar Sep 17 '24 19:09 KaanOzkan