8000 Added cmd2.Cmd.ppretty() pretty print output method by tleonhardt · Pull Request #1433 · python-cmd2/cmd2 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Added cmd2.Cmd.ppretty() pretty print output method #1433

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 3 commits into from
May 26, 2025
Merged

Conversation

tleonhardt
Copy link
Member
@tleonhardt tleonhardt commented May 26, 2025

Added cmd2.Cmd.ppretty() pretty print output method.

This method provides a way to pretty-print arbitrary Python structures similar to the pprint.pprint method in the standard library.

Closes #1416

As part of this PR I also managed to finally clean up the old broken checks from ancient use of AppVeyor and Travis-CI. This required using the GitHub API with a personal access token to send fake "success" statuses for each of these tools for the SHA associated with the last commit in this PR. So finally our PRs properly show All checks have passed like they should! For posterity because it took me freaking forever to figure out how to do it, here is an example command using curl:

curl -L \
  -X POST \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <GITHUB_API_TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/repos/python-cmd2/cmd2/statuses/bdb2d8449b65105367311737a09d6b074c209a92 \
  -d '{"state":"success","target_url":"https://appveyor.com","description":"The build succeeded!","context":"continuous-integration/appveyor/branch"}';

Lastly, this is the first PR where our Codecov Report is properly showing up in a long time. That required generating a token, storing that in GitHub secrets for the repo, and in a separate PR modifying our GitHub Actions workflow to use that token when uploading coverage reports to codecov.

This method provides a way to pretty-print arbitrary Python structures similar to the pprint.pprint method in the standard library.
@tleonhardt tleonhardt self-assigned this May 26, 2025
@tleonhardt tleonhardt added this to the 2.6.0 milestone May 26, 2025
Copy link
codecov bot commented May 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.56%. Comparing base (e3e5113) to head (fee7053).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1433   +/-   ##
=======================================
  Coverage   98.56%   98.56%           
=======================================
  Files          20       20           
  Lines        5723     5726    +3     
=======================================
+ Hits         5641     5644    +3     
  Misses         82       82           
Flag Coverage Δ
unittests 98.56% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tleonhardt tleonhardt merged commit 493a4c8 into master May 26, 2025
33 checks passed
@tleonhardt tleonhardt deleted the pprint branch May 26, 2025 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement: Add pretty print support for output
1 participant
0