Additional refactoring and consolidation#120
Merged
Merged
Conversation
- Missed a duplicate escape code / color issue - Refactor duplicate format code into util function - Convert old .format() calls to f-strings to simplify
4f91b27 to
cfbf598
Compare
Remove uv.lock from repo - helps version testing
TarEnethil
added a commit
to TarEnethil/termgraph
that referenced
this pull request
Feb 25, 2026
Support for the --no-readable argument was (accidentally?) removed in 41adfd4 Additional refactoring and consolidation (mkaz#120). With the refactored version of format_value, this is now an easy fix. Only call cvt_to_readable if no_readable is False (as it was before). It now also works for all chart types. Fixes 41adfd4 Signed-off-by: Thorben Roemer <thorbenroemer@t-online.de>
mkaz
pushed a commit
that referenced
this pull request
Mar 25, 2026
* Use format_value consistently * use format_value across all chart types * format_value now takes the full args object instead of individual parameters. * format_value evaluates the args format, percentage, suffix and no_values * cvt_to_readable is no longer responsible for percentage conversion * suffix is no longer appended when no_values is True Signed-off-by: Thorben Roemer <thorbenroemer@t-online.de> * Fix --no-readable argument Support for the --no-readable argument was (accidentally?) removed in 41adfd4 Additional refactoring and consolidation (#120). With the refactored version of format_value, this is now an easy fix. Only call cvt_to_readable if no_readable is False (as it was before). It now also works for all chart types. Fixes 41adfd4 Signed-off-by: Thorben Roemer <thorbenroemer@t-online.de> * Skip unnecessary argument checks Since Args self-initializes with a default, I see no reason to do excessive type checking. Signed-off-by: Thorben Roemer <thorbenroemer@t-online.de> * Add formatting tests Add tests that ensure formatting options are working as expected (and so that future refactorings don't break things again). A new helper function run_for_all_charts() is introduced. Histograms are optional, as their value/formatting works a bit differently. Signed-off-by: Thorben Roemer <thorbenroemer@t-online.de> * Add custom tick support for VerticalChart When changing test_custom_tick_appears_in_output() to use the new run_for_all_tests() function, I discovered that VerticalChart had no support for custom ticks. After a little refactoring (tick is now a member of Chart and only initialized once), all Charts now support custom ticks. Signed-off-by: Thorben Roemer <thorbenroemer@t-online.de> --------- Signed-off-by: Thorben Roemer <thorbenroemer@t-online.de>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.