Skip to content

Preserve non-breaking spaces at wrapped line edges - #595

Open
x0Lazarus wants to merge 4 commits into
hukkin:masterfrom
x0Lazarus:fix/preserve-wrapped-nonbreaking-spaces
Open

x0Lazarus wants to merge 4 commits into
hukkin:masterfrom
x0Lazarus:fix/preserve-wrapped-nonbreaking-spaces

Conversation

@x0Lazarus

@x0Lazarus x0Lazarus commented Sep 18, 2026 •

Copy link
Copy Markdown

Fixes #589.

Preserve Unicode whitespace at wrapped paragraph line edges by trimming only ASCII spaces and tabs. Six regressions cover leading and trailing U+00A0, U+2003 and U+202F, including idempotence.

This branch includes the same CI prerequisite history as #596: run the pinned docformatter hook with Python 3.12 and initialize InvalidPath's base exception. The initializer correction comes from @meek2100's #563, with added exception-contract regressions.

Validation at dfd3bd9 on Windows / Python 3.12.14: all 12 configured hooks pass; the full packaged tox suite has 4,289 passed, 6 skipped, 100% coverage. The required README hook, documentation formatting and mypy with the configured Python 3.13/Linux target also pass.

Hosted pre-commit and documentation checks now pass at this revision. The full GitHub Actions test workflow still awaits maintainer approval.

Reuse the InvalidPath initializer correction proposed by @meek2100 in
hukkin#563 (head
9f35047). Only the return annotation
and super().__init__(path) call are reused; no --config feature changes.

Add regression coverage for positional and keyword construction,
exception arguments, string rendering and pickle round trips. This
resolves B042 and preserves the exception contract.
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.

--wrap silently deletes a non-breaking space at a wrapped line edge

1 participant