Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor cli.rb to be smaller and testable #70

Open
wildmaples opened this issue Nov 13, 2020 · 1 comment
Open

Refactor cli.rb to be smaller and testable #70

wildmaples opened this issue Nov 13, 2020 · 1 comment
Labels
good first issue Good for newcomers

Comments

@wildmaples
Copy link
Contributor

wildmaples commented Nov 13, 2020

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.

@wildmaples wildmaples added the good first issue Good for newcomers label Nov 13, 2020
@wildmaples wildmaples changed the title Refactor cli.rb Refactor cli.rb to be smaller and testable Nov 13, 2020
@doodzik
Copy link
Contributor

doodzik commented Nov 16, 2020

@cindygshopify and I did some pairing on this the other day, and I thought we found a nice separation between the CLI and Command class. I think we can apply the same pattern for all the commands. Here is the implementation: https://github.com/Shopify/packwerk/pull/61/files#diff-66788d8e2cafe199807e9963fd538243bcdd6ab0ea3203f07464cb93109e78c0R12-R63

@wildmaples thanks for opening the issue, so we don't forget and can link back to this issue :)

This was referenced Nov 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants