Skip to content

Show more nonprinting characters in diagnostic fix diffs - #30062

Merged
MichaReiser merged 1 commit into
mainfrom
micha/show-nonprinting-diff-characters
Nov 5, 2026
Merged

MichaReiser merged 1 commit into
mainfrom
micha/show-nonprinting-diff-characters

Conversation

@MichaReiser

@MichaReiser MichaReiser commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Summary

After #30017, ruff format --check shows a deletion for a file containing only a byte order mark (BOM), but the deleted line looks empty. Render the BOM as � so the deletion is visible.

Fix diffs also show ASCII controls such as NUL as ␀, display bidirectional formatting controls as �, and omit zero-width joiners. This aligns our behavior with annotated snippets, with the exception of tabs (I left that unchanged for now). We could use the helper provided by annotated snippets if we decide to also replace tab characters with four spaces.

Test Plan

Updated the formatter and linter snapshots and ran the CLI, diagnostic renderer, and linter tests.

@MichaReiser MichaReiser added the diagnostics Diagnostic messages, annotations, fixes & rendering infra--not for PRs that just add new diagnostics label Nov 5, 2026
@astral-automations-bot

Copy link
Copy Markdown
Contributor

Memory usage report

Memory usage unchanged ✅


Results for 81a33cf · Workflow run

@MichaReiser MichaReiser changed the title Show nonprinting characters in diagnostic fix diffs Show more nonprinting characters in diagnostic fix diffs Nov 5, 2026
@astral-automations-bot

Copy link
Copy Markdown
Contributor

ecosystem-analyzer results

No diagnostic changes detected ✅

Full report with detailed diff · Timing results


Results for 81a33cf · Workflow run

@astral-automations-bot

Copy link
Copy Markdown
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Linter (stable) · Linter (preview)


Results for 81a33cf · Workflow run

@MichaReiser
MichaReiser marked this pull request as ready for review November 5, 2026 10:28
@MichaReiser
MichaReiser requested a review from a team as a code owner November 5, 2026 10:28
@MichaReiser
MichaReiser merged commit 1dd3e9e into main Nov 5, 2026
78 checks passed
@MichaReiser
MichaReiser deleted the micha/show-nonprinting-diff-characters branch November 5, 2026 17:03

This branch was previously deployed

1 inactive deployment
automations — 81a33cfc Deployed Nov 5, 2026 by MichaReiser via security-review / security review #97312
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

diagnostics Diagnostic messages, annotations, fixes & rendering infra--not for PRs that just add new diagnostics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants