Skip to content

Treat Ruff ignore comments as pragmas - #5261

Draft
Baltsat wants to merge 1 commit into
psf:mainfrom
Baltsat:codex/black-5260-ruff-ignore-pragma
Draft

Treat Ruff ignore comments as pragmas#5261
Baltsat wants to merge 1 commit into
psf:mainfrom
Baltsat:codex/black-5260-ruff-ignore-pragma

Conversation

@Baltsat

@Baltsat Baltsat commented Jul 26, 2026

Copy link
Copy Markdown

Summary

Fixes #5260, closes #5266

Testing

  • pytest tests/test_trans.py tests/test_format.py -k ruff
  • pre-commit run -a
  • env -u NO_COLOR tox -e py — 476 passed, 1 skipped; 73 Jupyter tests passed

AI-assisted contribution

AI assistance was used for investigation, implementation, testing, and review. I reviewed the final diff and verified all reported commands locally.

Checklist

  • The change includes regression coverage.
  • Add the PR-numbered entry to CHANGES.md.

Copilot AI review requested due to automatic review settings July 26, 2026 05:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Assisted-by: OpenAI Codex

User-Request: build reviewed OSS contributions | codex:019f8d3f-8848-72b1-9e8c-c2c71648e981
@Baltsat
Baltsat force-pushed the codex/black-5260-ruff-ignore-pragma branch from 937e02d to a04af92 Compare July 26, 2026 06:00
@github-actions

Copy link
Copy Markdown
Contributor

diff-shades results comparing this PR (a04af92) to main (db2e3e7):

--preview style (View full diff):
╭───────────────────────── Summary ──────────────────────────╮
│ 2 projects & 134 files changed / 1435 changes [+346/-1089] │
│                                                            │
│ ... out of 2 999 312 lines, 13 999 files & 22 projects     │
╰────────────────────────────────────────────────────────────╯

Differences found.

--stable style (View full diff):
╭───────────────────────── Summary ──────────────────────────╮
│ 2 projects & 134 files changed / 1423 changes [+343/-1080] │
│                                                            │
│ ... out of 2 999 312 lines, 13 999 files & 22 projects     │
╰────────────────────────────────────────────────────────────╯

Differences found.


What is this? | Workflow run | diff-shades documentation

@Baltsat
Baltsat marked this pull request as draft July 26, 2026 15:21
@Baltsat

Baltsat commented Jul 26, 2026

Copy link
Copy Markdown
Author

The current corpus run shows that the unconditional implementation changes stable output in 134 files. The issue spans two formatter paths: line-preservation via is_type_ignore_comment and string-transform protection via contains_pragma_comment. I can rework both behind a single --preview feature, requiring zero stable diff-shades while retaining focused stable/preview regressions. Is that the preferred scope? I have marked the PR draft while this is clarified.

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.

ruff:ignore should be processed as a pragma in contains_pragma_comment

2 participants