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

Help text improvements: group_tree_spacers, strict_usage_column_width #63

Merged
merged 3 commits into from
May 18, 2024

Conversation

dskrypa
Copy link
Owner

@dskrypa dskrypa commented May 18, 2024

Added new configurable options:

  • group_tree_spacers: Configure the characters that are used when show_group_tree is True
  • strict_usage_column_width: Control line wrapping for the usage column in help text

Removed the min_usage_column_width config option, which was poorly conceived and defined, and was part of a buggy implementation of help text formatting that resulted in different usage column widths depending on nested group level when show_group_tree is True.

Now, usage_column_width is treated as a strict value that is not modified. Commands with deeply nested ParamGroups that use show_group_tree=True may benefit from increasing the usage_column_width value from its default.

The relatively internal format_help_entry function was changed, along with some related ParamHelpFormatter methods. The tw_offset parameter was removed (related to the removal of the min_usage_column_width config option), and cont_indent was renamed to usage_cont_indent for clarification. Other changes were made to the way the code related to format_help_entry is implemented to make it slightly easier to read/follow.

dskrypa added 3 commits May 15, 2024 07:35
…; removed min_usage_column_width config option; improved group_tree formatting; removed/changed some internal params/functions related to help text entry formatting
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.32%. Comparing base (4bac88d) to head (f0f331e).
Report is 3 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #63   +/-   ##
=======================================
  Coverage   98.32%   98.32%           
=======================================
  Files          49       49           
  Lines        6616     6643   +27     
  Branches     1396     1400    +4     
=======================================
+ Hits         6505     6532   +27     
  Misses         95       95           
  Partials       16       16           
Flag Coverage Δ
unittests 98.32% <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.

@dskrypa dskrypa merged commit 7f4f371 into main May 18, 2024
7 checks passed
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.

2 participants