AaronC81 / sord

Convert YARD docs to Sorbet RBI and Ruby 3/Steep RBS files
https://sord.aaronc.cc
MIT License
293 stars 18 forks source link

Update Parlour and resolve root namespaces #170

Open dorner opened 1 year ago

dorner commented 1 year ago

This PR updates the version of Parlour to the latest (8.x) and also fixes a bug where the root Namespace Parlour type was not being parsed. 

tapioca exports classes in fully namespaced forms, so e.g. it prints this for the ruby-kafka gem:

class Kafka::Client
  def alter_configs(broker_id, configs = nil); end
  def alter_topic(name, configs = nil); end
  ...
end

This wasn't being picked up by sord because the Kafka constant is actually a Parlour::RbiGenerator::Namespace, which was not in the list of checked classes.

This PR allows for continuing to check the children of the root Namespace class without adding the namespace itself to the list of paths.

Note - took another look at this and Parlour is no longer shipping with an rbi folder - in fact, it seems like having an rbi folder in gems is no longer the accepted practice. This caused tests to fail. I've combined my previous PR with this and changed it so that it no longer checks these directories and in fact only checks the sorbet local directory.

Note 2 - looked again and other than issue #101 I haven't actually seen other problems with this. Going to put the RBI back and I found a different way to make the test pass.

dorner commented 12 months ago

I'm rethinking this as per my comments in #172 . Would love to hear feedback on that before merging this.