Shopify / rubocop-sorbet

A collection of RuboCop rules for Sorbet
MIT License
182 stars 27 forks source link

WIP: Add a cop that compacts classes/modules with more than one child #118

Closed wildmaples closed 2 years ago

wildmaples commented 2 years ago

Goal

Create a cop like RuboCop::Cop::Style::ClassAndModuleChildren that is able to compact multiple children rather than just one child so we can use it on RBIs

WIP

July 28th - group pairing
We were trying to make 2 nested classes compaction work, and there's a test for it. A nested module with two class returns an AST with a different format, i.e. it now has a begin node containing the two nested classes. We need to figure out how to iterate through the AST past the begin node.

Next time, we decided should consider creating a brand new cop instead of inheriting from RuboCop::Cop::Style::ClassAndModuleChildren

github-actions[bot] commented 2 years ago

This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.