Iron gauntlets/simplify cmd
Fixes | Closes | Resolves #
Description
Explanation about why the PR is necessary.
Changes:
- Change 1
- Change 2
Types of changes
Leave only items that describe your changes, remove the rest. Remove this line too.
- Bugfix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing functionality to not work as expected)
- Documentation Update
- Code style update (formatting, renaming)
- Refactoring (no functional changes, no api changes)
- Build related changes
- Other (please describe):
Testing
Requires testing: Yes/No
Did you write tests??: Yes/No
Documentation
If this requires a documentation update, did you add one? Yes/No
Codecov Report
Merging #359 (88ff110) into main (8d4c892) will decrease coverage by
7.41%. The diff coverage is80.73%.
:exclamation: Current head 88ff110 differs from pull request most recent head 0bd8a09. Consider uploading reports for the commit 0bd8a09 to get more accurate results
@@ Coverage Diff @@
## main #359 +/- ##
==========================================
- Coverage 99.53% 92.12% -7.42%
==========================================
Files 55 66 +11
Lines 6484 7087 +603
==========================================
+ Hits 6454 6529 +75
- Misses 30 554 +524
- Partials 0 4 +4
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 92.12% <80.73%> (-7.42%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| cmd/juno/main.go | 0.00% <0.00%> (ø) |
|
| internal/sync/sync.go | 100.00% <ø> (ø) |
|
| internal/utils/datadir.go | 65.62% <65.62%> (ø) |
|
| cmd/juno/juno.go | 86.04% <86.04%> (ø) |
|
| internal/juno/juno.go | 100.00% <100.00%> (ø) |
|
| internal/log/log.go | 100.00% <100.00%> (ø) |
|
| internal/utils/network.go | 100.00% <100.00%> (ø) |
|
| internal/rpc/starknet/errors.go | 0.00% <0.00%> (ø) |
|
| pkg/jsonrpc/providers/http/provider.go | 0.00% <0.00%> (ø) |
|
| ... and 5 more |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
The previous structure also allowed the binary to be automatically named
junowhen one rango build ./cmd/juno/. Now it's going to becmdwhich is not idiomatic. See reference or how Kubernetes or even geth does it.
I am happy to follow the geth style:
cmd/juno
main.go
juno.go
juno_test.go
I am a bit apprehensive about your suggestion because I don't want to introduce another internal package. When it comes to the cmd package there is an assumption that it is not meant to be imported.
The logic in
internal/junois also not as reusable as some of the packages in there so I would also favour moving that logic to thecmd/juno/internal/directory above.
I am not sure which part you are referring to that is not reusable.
I am happy to follow the geth style:
cmd/juno main.go juno.go juno_test.go
That works for me.
I am not sure which part you are referring to that is not reusable.
I suppose it doesn't matter since the existing structure is that of a monolith 🤔 you can disregard that comment.