Skip to content

Fix --add-noqa creating unwanted leading whitespace#23773

Merged
amyreese merged 2 commits intomainfrom
amy/add-noqa-whitespace
Mar 9, 2026
Merged

Fix --add-noqa creating unwanted leading whitespace#23773
amyreese merged 2 commits intomainfrom
amy/add-noqa-whitespace

Conversation

@amyreese
Copy link
Copy Markdown
Member

@amyreese amyreese commented Mar 7, 2026

When generating a new #noqa comment in --add-noqa, check to see
if the line is blank or not, and if it's blank, don't write the
leading whitespace.

Fix #23751

When generating a new `#noqa` comment in `--add-noqa`, check to see
if the line is blank or not, and if it's blank, don't write the
leading whitespace.

Fix #23751
@astral-sh-bot astral-sh-bot bot requested a review from ntBre March 7, 2026 02:04
@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot bot commented Mar 7, 2026

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@amyreese amyreese added bug Something isn't working suppression Related to supression of violations e.g. noqa labels Mar 7, 2026
Copy link
Copy Markdown
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@amyreese amyreese enabled auto-merge (squash) March 9, 2026 19:44
@amyreese amyreese merged commit fbfd873 into main Mar 9, 2026
42 checks passed
@amyreese amyreese deleted the amy/add-noqa-whitespace branch March 9, 2026 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working suppression Related to supression of violations e.g. noqa

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--add-noqa for diagnostics on blank lines results in bad whitespace

3 participants