Files
ruff/crates/ty_python_semantic/resources/lint_docs/missing-attribute.md
David Peter fb03e3cff8 [ty] Use "Rule history" sections consistently (#30258)
# Summary

Follow-up to [the review comment on
#30143](https://github.com/astral-sh/ruff/pull/30143#discussion_r4513626692).
Move the migration notes for the four rules that were split in 0.0.100
into "Rule history" sections.
2026-11-10 10:26:10 +01:00

1.0 KiB

What it does

Checks for references to attributes that ty cannot find on the object's type. For a union, this rule applies when every member lacks the attribute. If only some members lack it, ty reports missing-union-attribute.

Why is this bad?

Accessing an unbound attribute will raise an AttributeError at runtime. An unresolved attribute is not guaranteed to exist from the type alone, so this could also indicate that the object is not of the type that the user expects.

Examples

class A: ...


# AttributeError: 'A' object has no attribute 'foo'
A().foo  # error

Rule history

  • v0.0.100: ty used to have a rule called unresolved-attribute that covered both missing-attribute and missing-union-attribute.

    The old unresolved-attribute name is now an alias for missing-attribute only. If you previously had any configuration for unresolved-attribute specifically, you should go through missing-union-attribute to see if you want to configure it in the same way.