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

Solve weekly technical debt #13

Merged
merged 14 commits into from
Apr 22, 2019
Merged

Solve weekly technical debt #13

merged 14 commits into from
Apr 22, 2019

Conversation

dmytrostriletskyi
Copy link
Contributor

@dmytrostriletskyi dmytrostriletskyi commented Apr 16, 2019

Solve weekly technical debt:

  • out-of-dated branch with the base branch docs section,
  • add style guide references,
  • format to f-notation,
  • integrate isort difference with failed status to the CI,
  • fix get balance by address — address argument help message,
  • FAILED_EXIT_FROM_COMMAND > FAILED_EXIT_FROM_COMMAND_CODE,
  • cover get balance by address command with testsm
  • migrate from custom arguments checking to forms.

@codecov-io
Copy link

codecov-io commented Apr 16, 2019

Codecov Report

Merging #13 into develop will increase coverage by 20.2%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop      #13      +/-   ##
===========================================
+ Coverage    78.78%   98.98%   +20.2%     
===========================================
  Files            7        9       +2     
  Lines           66       99      +33     
===========================================
+ Hits            52       98      +46     
+ Misses          14        1      -13
Impacted Files Coverage Δ
cli/account/help.py 100% <100%> (ø) ⬆️
cli/account/cli.py 100% <100%> (+43.47%) ⬆️
cli/constants.py 100% <100%> (ø) ⬆️
cli/account/forms.py 100% <100%> (ø)
cli/utils.py 100% <100%> (ø)
cli/entrypoint.py 100% <0%> (+14.28%) ⬆️
cli/account/service.py 100% <0%> (+28.57%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5be9279...accbc1a. Read the comment docs.

@dmytrostriletskyi dmytrostriletskyi force-pushed the weekly-tech-debt branch 2 times, most recently from fd42bc7 to 0f01dc7 Compare April 19, 2019 15:54
README.md Outdated
@@ -94,7 +102,7 @@ Get balance of the account by its address — ``remme account get-balance``:

| Arguments | Type | Required | Description |
| :-------: | :----: | :-------: | --------------------------------------------------- |
| address | String | Yes | Get balance of the account by its address. |
| address | String | Yes | Account address to get a balance by. |
| node-url | String | No | Apply the command to the specified node by its URL. |
Copy link
Contributor

Choose a reason for hiding this comment

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

Node URL to apply the command to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Art17, done.

README.md Outdated

![Example of the CI which passed](https://habrastorage.org/webt/oz/fl/-n/ozfl-nl-jynrh7ofz8yuz9_gapy.png)
1. [Branch isn't out-of-date with the base branch](https://habrastorage.org/webt/ux/gi/wm/uxgiwmnft08fubvjfd6d-8pw2wq.png).
2. [Have wrote the description of the pull request and have added at least 2 reviewers](https://github.com/camo/55c309334a8b61a4848a6ef25f9b0fb3751ae5e9/68747470733a2f2f686162726173746f726167652e6f72672f776562742f74312f70792f63752f7431707963753162786a736c796f6a6c707935306d7862357969652e706e67).
Copy link
Contributor

@Art17 Art17 Apr 22, 2019

Choose a reason for hiding this comment

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

Have wrote > Have written.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Art17, done.

])

assert PASSED_EXIT_FROM_COMMAND_CODE == result.exit_code
assert True is isinstance(json.loads(result.output), int)
Copy link
Contributor

Choose a reason for hiding this comment

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

assert isinstance(json.loads(result.output), int)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Art17, done.


remme = Remme(private_key_hex=None, network_config={
remme = Remme(network_config={
Copy link
Contributor

Choose a reason for hiding this comment

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

Create a function that returns Remme object, because its code reuses all functions in command/cli.py.
Like here: click

Copy link
Contributor Author

@dmytrostriletskyi dmytrostriletskyi Apr 22, 2019

Choose a reason for hiding this comment

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

@Alladin9393, there is no:

if node_url is None:
    node_url = 'localhost'

anymore. The initialization of the remme object only. I do not think, we should create a separated function for object creation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Alladin9393, maybe we could write the code in the following way:

remme = Remme(network_config={'node_address': str(node_url) + ':8080', })

To make it smaller. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

@dmytrostriletskyi, Ok, let it be as it is now.

})

if errors:
click.echo(dict_to_pretty_json(errors))
Copy link
Contributor

Choose a reason for hiding this comment

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

Stylize please error output.
Example

Copy link
Contributor Author

@dmytrostriletskyi dmytrostriletskyi Apr 22, 2019

Choose a reason for hiding this comment

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

@Alladin9393, your approach has:

  1. Additional function.
  2. Which is based on marshmallow (so it has dependency).

We could remove additional function, and just do the following:

pprint(dict_to_pretty_json(errors))

And the result would be the same but without library's dependency using already created custom code in dict_to_pretty_json.

Copy link
Contributor

Choose a reason for hiding this comment

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

@dmytrostriletskyi, ok, I think its better pprint(dict_to_pretty_json(errors)).

@delete-merged-branch delete-merged-branch bot deleted the weekly-tech-debt branch April 22, 2019 11:20
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.

5 participants