Refactor cli.rb to be smaller and testable
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 1.9k
- Forks
- 121
- Avg merge
- 2m
- Merged PRs (30d)
- 1
Description
As @doodzik mentioned in https://github.com/Shopify/packwerk/pull/61/files#r517545831, we should look into refactoring cli.rb as it is growing to be a large class.
We should move all of the different commands we have in to compositional objects, so we can just do something like command.run. Breaking this class up would make it easier to have unit tests.
I would also be curious to see how RuboCop implements their Cli class.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading cli.rb to map its current commands and responsibilities. Compare the structure with RuboCop's Cli class, then define compositional command objects with a command.run interface and unit-testable boundaries. Done means cli.rb is smaller, commands are separated, and the refactoring makes unit tests easier to add.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- cli
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100