Skip to content
New issue

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

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

Already on GitHub? # to your account

refactor: add PrintOrErr util function and improve devux in cli commands #1157

Merged
merged 3 commits into from
Jul 22, 2022

Conversation

robert-zaremba
Copy link
Member

Description

In cli code we have a lot of code repetition related to handling error and printing proto message.

This PR introduces a PrintOrErr util function to reduce repeated code.


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • added appropriate labels to the PR
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@codecov-commenter
Copy link

codecov-commenter commented Jul 22, 2022

Codecov Report

Merging #1157 (3307b97) into main (ad59e36) will increase coverage by 0.48%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1157      +/-   ##
==========================================
+ Coverage   43.65%   44.13%   +0.48%     
==========================================
  Files          65       65              
  Lines        8460     8367      -93     
==========================================
  Hits         3693     3693              
+ Misses       4523     4430      -93     
  Partials      244      244              
Impacted Files Coverage Δ
x/leverage/client/cli/query.go 0.00% <0.00%> (ø)

Copy link
Member

@toteki toteki 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 - just add a godoc for the utility function (even though it's small) and it's good to go

@toteki
Copy link
Member

toteki commented Jul 22, 2022

Oh, and might also change to refactor prefix in PR title

@robert-zaremba robert-zaremba changed the title feat: add PrintOrErr util function and improve devux in cli commands refactor: add PrintOrErr util function and improve devux in cli commands Jul 22, 2022
@robert-zaremba robert-zaremba force-pushed the robert/devx-printresp branch from 3307b97 to c476f45 Compare July 22, 2022 09:35
@robert-zaremba robert-zaremba requested a review from a team as a code owner July 22, 2022 09:35
@mergify mergify bot merged commit 4feb986 into main Jul 22, 2022
@mergify mergify bot deleted the robert/devx-printresp branch July 22, 2022 09:57
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants