build-image
build-image copied to clipboard
Source Review: Try Pattern implementation is not in line with convention or expectation
https://github.com/tmds/build-image/blob/0f398a6b36362f4d295931d046dbdb2f1dbab1e6/src/build-image/ContainerEngine.cs#L40
We should be returning an integral value (bool or int) and using out param on the method.
Edit: I referenced link to the incorrect line.
we can also refactor the method implementation at bit there as well,
- quite a few of those operations (collection instance of
ProcessStartInfo) aren't caller instance dependent (since they are manifested fromDockerandProdmanconst, respectfully) and could otherwise be static readonly initialized. - based on the behavior, we don't need to break out of the loop, we can
return-- removing the need to declare the variableversionandcommandoutside of the loop.
If you make a PR that improves the style and readability of the code, I'll take it.
I don't intend to change it myself unless I'm making functional changes in that area.
Closing, as I have no plans to re-factor this code.