Skip to content

fix: preserve fixed boxes with None alignment - #463

Draft
MbappeWU wants to merge 3 commits into
astanin:masterfrom
MbappeWU:fix/noalign-boxed-tables
Draft

MbappeWU wants to merge 3 commits into
astanin:masterfrom
MbappeWU:fix/noalign-boxed-tables

Conversation

@MbappeWU

@MbappeWU MbappeWU commented Oct 3, 2026 •

Copy link
Copy Markdown

Fixes #294.

With stralign=None, a pretty table sizes its border for the widest cell but leaves shorter rows unpadded. Preserve the cell and header contents while adding the space required by closed, fixed-width text boxes. Use the existing TableFormat row/line metadata to identify those boxes; plain output and flexible markup keep their existing no-alignment behavior.

Tests cover whitespace, headers, multiple columns, multiline rows, separators/indexes, custom boxes, open/callable lines, and header-only formats. Numeric parsing is unchanged.

LLM assistance: Codex. The independent reviews were performed by agents; no human review is claimed.

Validation and the existing lint blocker
  • Full suite with NumPy, pandas and wcwidth: 388 passed, 1 skipped. Bare environment: 329 passed, 60 skipped. Both include module/README doctests. The final focused tests give 3 failures and 3 passing controls against exact upstream 268615a, and all 6 pass with this patch.
  • Original pytest matrix passed all 15 Linux/Windows/macOS × Python 3.10–3.14 jobs, each 388 passed and 1 skipped. Fork CI head affc1d8 differs from source 339649d only by a manual trigger in lint.yml; all 26 tracked entries and the original jobs/steps were compared.
  • Project-pinned Ruff 0.15.4 lint and formatting pass. The unpinned lint job fails under Ruff 0.16.10: all 13 tracked Python files produce the same 272 diagnostics on the exact base and this branch. Ruff 0.16 expanded defaults and Markdown formatting; existing PR Bump ruff #454 handles that upgrade. The failing job is not reported as passed, and this patch does not weaken rules or change workflows.
  • A private integration with existing PR Bump ruff #454 merged cleanly, passed Ruff 0.16.10 lint/format, and ran 388 passed / 1 skipped. This tests both patches together; the current standalone branch retains the disclosed lint blocker and is submitted as a draft.
  • An isolated installed wheel and source matched across 17 public API cases, including 7 box geometry cases and baseline-equal flexible-format/numeric controls. Three real CSV/JSONL CLI invocations matched the base. None alignment was tested through the Python API; the CLI has no invented None flag. Wheel/sdist tracked runtime modules matched the final source byte for byte.

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.

stralign=None breaks table completely

1 participant