ruff/crates/ty/tests/cli
Alex Waygood 1f8297cfe6
[ty] Improve error messages for unresolved attribute diagnostics (#20963)
## Summary

- Type checkers (and type-checker authors) think in terms of types, but
I think most Python users think in terms of values. Rather than saying
that a _type_ `X` "has no attribute `foo`" (which I think sounds strange
to many users), say that "an object of type `X` has no attribute `foo`"
- Special-case certain types so that the diagnostic messages read more
like normal English: rather than saying "Type `<class 'Foo'>` has no
attribute `bar`" or "Object of type `<class 'Foo'>` has no attribute
`bar`", just say "Class `Foo` has no attribute `bar`"

## Test Plan

Mdtests and snapshots updated
2025-10-19 10:58:25 +01:00
..
config_option.rs [ty] Remove 'pre-release software' warning (#20817) 2025-10-13 19:50:19 +02:00
exit_code.rs [ty] Remove 'pre-release software' warning (#20817) 2025-10-13 19:50:19 +02:00
file_selection.rs [ty] Remove 'pre-release software' warning (#20817) 2025-10-13 19:50:19 +02:00
main.rs Standardize syntax error construction (#20903) 2025-10-16 11:56:32 -04:00
python_environment.rs [ty] Improve error messages for unresolved attribute diagnostics (#20963) 2025-10-19 10:58:25 +01:00
rule_selection.rs [ty] Add suggestion to unknown rule diagnostics, rename unknown-rule lint to ignore-comment-unknown-rule (#20948) 2025-10-18 12:44:21 +02:00