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

Factor out the injectorFactory #1202

Merged
merged 3 commits into from Jan 12, 2022
Merged

Conversation

shonfeder
Copy link
Contributor

@shonfeder shonfeder commented Jan 9, 2022

This tiny refactor is just some incidental cleanup on the CLI plumbing.

  • It removes the injectorFacotry
  • It reorders the arguments to handleExceptions

In the current state of the code, the injectorFactory looks like it's
just adding unhelpful indirection. Removing it allows us to save about
10 lines of code and remove an unreachable throw.

The arguments to handleExceptions are reordered to reflect the the
underlying logic better. I.e., we call the runner on the injector
and cmd, so the runner is now supplied first.


  • Ran make fmt-fix (or had formatting run automatically on all files edited)

@shonfeder shonfeder requested a review from Kukovec January 9, 2022 23:07
This tiny refactor is just some incidental cleanup on the CLI plumbing.

- It removes the `injectorFacotry`
- It reorders the arguments to `handleExceptions`

In the current state of the code, the injectorFactory looks like it's
just adding unhelpful indirection. Removing it allows us to save about
10 lines of code and remove an unreachable throw.

The arguments to `handleExceptions` are reordered to reflect the the
underlying logic better. I.e., we call the `runner` on the `injector`
and `cmd`, so the `runner` is now supplied first.
@shonfeder shonfeder force-pushed the shon/refactor-injectory-factory branch from dd11c0b to 315bebf Compare January 9, 2022 23:10
Copy link
Contributor

@konnov konnov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@shonfeder shonfeder merged commit 6eb2c05 into unstable Jan 12, 2022
@shonfeder shonfeder deleted the shon/refactor-injectory-factory branch February 4, 2022 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants