mirror of https://github.com/astral-sh/ruff
## Summary Improve the diagnostic range for `invalid-assignment` diagnostics, and add source annotations for the value and target type. closes https://github.com/astral-sh/ty/issues/1556 ### Before <img width="836" height="601" alt="image" src="https://github.com/user-attachments/assets/a48219bb-58a8-4a83-b290-d09ef50ce5f0" /> ### After <img width="857" height="742" alt="image" src="https://github.com/user-attachments/assets/cfcaa4f4-94fb-459e-8d64-97050dfecb50" /> ## Ecosystem impact Very good! Due to the wider diagnostic range, we now pick up more `# type: ignore` directives that were supposed to suppress an invalid assignment diagnostic. ## Test Plan New snapshot tests |
||
|---|---|---|
| .. | ||
| attribute_assignment.md | ||
| invalid_argument_type.md | ||
| invalid_assignment.md | ||
| invalid_await.md | ||
| legacy_typevars.md | ||
| missing_argument.md | ||
| no_matching_overload.md | ||
| same_names.md | ||
| semantic_syntax_errors.md | ||
| shadowing.md | ||
| single_matching_overload.md | ||
| too_many_positionals.md | ||
| union_call.md | ||
| unknown_argument.md | ||
| unpacking.md | ||
| unresolved_import.md | ||
| unresolved_reference.md | ||
| unsupported_bool_conversion.md | ||
| version_related_syntax_errors.md | ||