Add a "flat" formatting option
@manhhung741 suggested this on the original Sord RFC for this project, and I think it's a good option to have. If this option is set, then generate this style:
module A
end
class A::B
end
Rather than this:
module A
class B
end
end
Bumping this - this is more than an option, this needs to be the new output format. RBI has serious trouble parsing the current format and being able to match constants.
For example, this RBI output by Parlour:
module Deimos
class BatchRecordList
sig { params(records: T::Array[BatchRecord]).void }
def initialize(records); end
end
end
module Deimos
class BatchRecord
end
end
RBI will complain that it can't find BatchRecord even though it shares the same parent module, because when Tapioca reads the rbi files of the gems, it flattens them into the A::B format. This makes this nested lookup flat out not work.
In other words, when Sord outputs this code, everything looks fine, but when processed by Tapioca in a downstream project it starts failing.