Our noqa parsing still considers the trailing or nested comment on the second line to be a valid suppression, but our ruff:ignore parsing does not. The first three lines suppress F401, but the last doesn't:
import math # noqa: F401
import math # some comment # noqa: F401
import math # ruff:ignore[F401]
import math # some comment # ruff:ignore[F401]
Playground
ty also captures the noqa behavior, so this seems like a bug in our ruff:ignore handling:
main.py:
x: str = 1 # ty:ignore[invalid-assignment]
x: str = 1 # some comment # ty:ignore[invalid-assignment]
Playground
This came up while I was working on #25537 and thought of #25414.
Our
noqaparsing still considers the trailing or nested comment on the second line to be a valid suppression, but ourruff:ignoreparsing does not. The first three lines suppressF401, but the last doesn't:Playground
ty also captures the
noqabehavior, so this seems like a bug in ourruff:ignorehandling:main.py:Playground
This came up while I was working on #25537 and thought of #25414.