Skip to content

Minimize public API of cmd2.Cmd class #703

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

Merged
merged 14 commits into from
Jun 24, 2019
Merged

Minimize public API of cmd2.Cmd class #703

merged 14 commits into from
Jun 24, 2019

Conversation

tleonhardt
Copy link
Member

@tleonhardt tleonhardt commented Jun 15, 2019

Numerous changes have been made in order to minimize the public API of the cmd2.Cmd class in preparation for moving to Semantic Versioning starting with the 1.0 release of cmd2.

I also refactored some of the unit tests to make them less dependent on specific implementation and more resilient to adding, deleting, or renaming commands.

Additionally, I started to refactor how information is displayed to the user when running in transcript testing mode.

Closes #677
Closes #683
Closes #691
Closes #695

TODO:

  • @kmvanbrunt review tab-completion related member variables around cmd2.py lines 482 - 517
  • @kmvanbrunt review tab-completion related methods around cmd2.py lines 703 - 1573
  • @kotfu make sure the changes broadly match your expectations in terms of the 3 categories you outlined in Minimize public API #677

@tleonhardt tleonhardt added this to the 0.9.14 milestone Jun 15, 2019
@tleonhardt tleonhardt requested review from kotfu and kmvanbrunt June 15, 2019 20:20
@tleonhardt tleonhardt requested a review from anselor as a code owner June 15, 2019 20:20
@tleonhardt tleonhardt self-assigned this Jun 15, 2019
@codecov
Copy link

codecov bot commented Jun 15, 2019

Codecov Report

Merging #703 into master will increase coverage by 0.05%.
The diff coverage is 97.43%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #703      +/-   ##
==========================================
+ Coverage   95.46%   95.52%   +0.05%     
==========================================
  Files          11       11              
  Lines        3265     3282      +17     
==========================================
+ Hits         3117     3135      +18     
+ Misses        148      147       -1
Impacted Files Coverage Δ
cmd2/parsing.py 100% <ø> (ø) ⬆️
cmd2/transcript.py 93.69% <100%> (ø) ⬆️
cmd2/utils.py 98.2% <100%> (+0.53%) ⬆️
cmd2/pyscript_bridge.py 100% <100%> (ø) ⬆️
cmd2/constants.py 100% <100%> (ø) ⬆️
cmd2/cmd2.py 95.59% <96.74%> (-0.02%) ⬇️

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 c12ba0f...eb1936e. Read the comment docs.

…ELP and BASE_HELP_VERBOSE constants

The tests are now much more resilient to adding, removing, or renaming commands
…doesn't need to be changed any time the content of help changes

Now the only test which should need to change when a command is added, deleted, or renamed (which isn't specifically related to that command) is test_get_all_commands
… along with unit tests for it

This function isn't used yet, but I have plans to use it when improving the output of transcript testing
@tleonhardt
Copy link
Member Author

I'm going to go ahead and merge this. If anyone has further feedback, we can create another PR.

@tleonhardt tleonhardt merged commit bef0774 into master Jun 24, 2019
@tleonhardt tleonhardt deleted the public_api branch June 24, 2019 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant