Repository navigation
Apply integer formats to signed ANSI-colored values - #486
Open
rupayon123 wants to merge 1 commit into
Open
rupayon123 wants to merge 1 commit into
rupayon123 wants to merge 1 commit into
Conversation
agammann
approved these changes
Nov 1, 2026
agammann
left a comment
There was a problem hiding this comment.
I reviewed the signed-number path at 843eaee. The optional sign is now included in the color reconstruction before integer formatting, while the no-format branch retains a leading plus, zeros, and negative zero as supplied. All eleven targeted color and intfmt cases pass locally on Python 3.14.8, including the per-column format control. I did not run the full dependency and platform matrix.
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.
A signed integer inside an ANSI color sequence is recognized as numeric but skips the requested integer format. For example, red
-1234withintfmt=","is printed as-1234, while the same unsigned value receives the separator.Allow one optional sign in the existing color reconstruction and apply the requested format to signed values. When a format is omitted, retain the supplied text, including a leading plus, leading zeros or negative zero. Tests also cover a column without a corresponding per-column format.
On macOS arm64/Python 3.13.14, all 392 tests and doctests pass with one existing skip, including the NumPy, pandas and wcwidth tests. The pinned Ruff 0.15.4 checks, package builds and twine checks pass. Four CLI cases run from the built wheel produce the expected bytes. Optional Ruff 0.17.3 reports the same 269 existing diagnostics on pristine master and this patch; it introduces none. Other Python/OS combinations and visual terminal rendering were not tested locally.