Describe the bug
ruff:ignore is not processed as a pragma.
To Reproduce
For example, take this code:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx = 5 # ruff:ignore[bweh]
And run it with these arguments:
The resulting output is:
--- x.py 2026-07-26 00:36:44.849442+00:00
+++ x.py 2026-07-26 00:36:45.724865+00:00
@@ -1 +1,3 @@
-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx = 5 # ruff: ignore[bweh]
+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx = (
+ 5 # ruff: ignore[bweh]
+)
Expected behavior
No reformatting (which is what happens if you replace this with type: ignore).
Environment
- Black's version: 26.5.1
- OS and Python version: macOS CPython 3.14.2
Additional context
This is probably going to become more popular as ruff has a rule in preview that converts all noqa to ruff:ignore. See https://docs.astral.sh/ruff/rules/noqa-comments/
Describe the bug
ruff:ignoreis not processed as a pragma.To Reproduce
For example, take this code:
And run it with these arguments:
The resulting output is:
Expected behavior
No reformatting (which is what happens if you replace this with
type: ignore).Environment
Additional context
This is probably going to become more popular as ruff has a rule in preview that converts all
noqatoruff:ignore. See https://docs.astral.sh/ruff/rules/noqa-comments/