[ty] Support type:ignore[ty:code] suppressions by MichaReiser · Pull Request #24096 · astral-sh/ruff (original) (raw)
added the ty
Multi-file analysis & type inference
label
charliermarsh pushed a commit to astral-sh/ty that referenced this pull request
carljm added a commit that referenced this pull request
- main:
[ty] Avoid eager TypedDict diagnostics in
TypedDict | dictunions (#24151)F507: Fix false negative for non-tuple RHS in%-formatting (#24142) [ty] UpdateSpecializationBuilderhook to get both lower/upper bounds (#23848) Fix%foo?parsing in IPython assignment expressions (#24152)E501/W505/formatter: Exclude nested pragma comments from line width calculation (#24071) [ty] Fix Salsa panic propagation (#24141) [ty] Supporttype:ignore[ty:code]suppressions (#24096) [ty] Support narrowing for extended walrus targets (#24129)
This was referenced
May 11, 2026
martinpitt pushed a commit to martinpitt/barrage that referenced this pull request
Since astral-sh/ruff#24096, ty no longer treats
mypy-style # type: ignore[code] comments as blanket suppressions: it
now matches the bracketed code against its own rule names, so our mypy
codes (assignment, attr-defined, type-var, ...) suppress nothing.
Add # ty: ignore[code] markers alongside the mypy ones.
Unfortunately ty does not support putting suppression comments on the
preceding line, so re-wrap the _ContextEnviron assignment. mypy
attributes the error to the value expression while ty attributes it to
the assignment target, so the two markers end up on different physical
lines.
Signed-off-by: Martin Pitt martin@amutable.com
daandemeyer pushed a commit to amutable-systems/barrage that referenced this pull request
Since astral-sh/ruff#24096, ty no longer treats
mypy-style # type: ignore[code] comments as blanket suppressions: it
now matches the bracketed code against its own rule names, so our mypy
codes (assignment, attr-defined, type-var, ...) suppress nothing.
Add # ty: ignore[code] markers alongside the mypy ones.
Unfortunately ty does not support putting suppression comments on the
preceding line, so re-wrap the _ContextEnviron assignment. mypy
attributes the error to the value expression while ty attributes it to
the assignment target, so the two markers end up on different physical
lines.
Signed-off-by: Martin Pitt martin@amutable.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})