refactor: remove logger from create command#366
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #366 +/- ##
==========================================
+ Coverage 65.09% 65.21% +0.12%
==========================================
Files 216 216
Lines 18082 18026 -56
==========================================
- Hits 11770 11756 -14
+ Misses 5222 5179 -43
- Partials 1090 1091 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
mwbrooks
left a comment
There was a problem hiding this comment.
Comments for the patient reviewers 🙇🏻
| ### Formatting | ||
|
|
||
| Always run `gofmt -w` on changed Go files after making edits to ensure proper formatting. | ||
|
|
There was a problem hiding this comment.
note: Just adding this to scratch an itch where Claude fails to format files correctly.
| var appCreateSpinner *style.Spinner | ||
|
|
||
| const copyTemplate = "Copying" | ||
| const cloneTemplate = "Cloning" | ||
|
|
There was a problem hiding this comment.
note: Removing because the spinner was never started in the current code.
| case "on_app_create_template_default": | ||
| printAppCreateDefaultemplate(cmd, event) | ||
| case "on_app_create_template_custom": | ||
| printAppCreateCustomTemplate(cmd, event) |
There was a problem hiding this comment.
note: Neither of these events were ever called. This is why the spinner was never started.
| case "on_app_create_completion": | ||
| printProjectCreateCompletion(clients, cmd, event) |
There was a problem hiding this comment.
note: This event was correctly called, but the spinner was never started so any calls to stop it are ignored.
There was a problem hiding this comment.
⭐ praise: @mwbrooks This is upsetting to find! I'm sure these codeblocks have sent others down a rabbit hole before... Let's keep things simple! Thanks for these changes.
There was a problem hiding this comment.
@zimeg Totally agree, I imagine others have followed this logic and weaved their changes into it. It would have been very difficult to debug only to realize that the code is never actually executed. 😢
| // Notify listeners | ||
| log.Log("info", "on_app_create_template") |
There was a problem hiding this comment.
note: This event name doesn't exist 🤦🏻 It should have been on_app_create_template_[default|custom].
| case "on_app_create_completion": | ||
| printProjectCreateCompletion(clients, cmd, event) |
There was a problem hiding this comment.
⭐ praise: @mwbrooks This is upsetting to find! I'm sure these codeblocks have sent others down a rabbit hole before... Let's keep things simple! Thanks for these changes.
The Create mock was called with 4 argument matchers but the function only accepts 3 parameters (ctx, clients, createArgs).
|
Thanks again for the review @zimeg! 🎉 It looks like the create command is ready to be merged free from the |
Changelog
Summary
This pull request is part 2 of removing internal/logger package and is focused on the the
createcommand.appCreateSpinneris removed because it was never usedTest Steps
Requirements