ruff/crates/red_knot_python_semantic/src
David Peter e345307260
[red-knot] Fix diagnostic range for non-iterable unpacking assignments (#15994)
## Summary

I noticed that the diagnostic range in specific unpacking assignments is
wrong. For this example

```py
a, b = 1
```

we previously got (see first commit):

```
error: lint:not-iterable
 --> /src/mdtest_snippet.py:1:1
  |
1 | a, b = 1
  | ^^^^ Object of type `Literal[1]` is not iterable
  |
```

and with this change, we get:

```
error: lint:not-iterable
 --> /src/mdtest_snippet.py:1:8
  |
1 | a, b = 1
  |        ^ Object of type `Literal[1]` is not iterable
  |
```

## Test Plan

New snapshot tests.
2025-02-06 15:36:22 +01:00
..
module_resolver [red-knot] Support custom typeshed Markdown tests (#15683) 2025-01-23 12:36:38 +01:00
semantic_index [red-knot] Combine terminal statement support with statically known branches (#15817) 2025-02-05 17:47:49 -05:00
types [red-knot] Fix diagnostic range for non-iterable unpacking assignments (#15994) 2025-02-06 15:36:22 +01:00
util [red-knot] Improve ergonomics for the `PySlice` trait (#13983) 2024-10-29 20:40:59 +00:00
ast_node_ref.rs `@no_type_check` support (#15122) 2024-12-30 09:42:18 +00:00
db.rs [red-knot] Rename `TestDbBuilder::typeshed` to `.custom_typeshed` (#15712) 2025-01-24 10:25:23 +00:00
lib.rs [red-knot] Rename *_ty functions (#15617) 2025-01-22 09:06:56 +01:00
lint.rs [red-knot] Add `--ignore`, `--warn`, and `--error` CLI arguments (#15689) 2025-01-24 16:20:15 +01:00
module_name.rs Bind top-most parent when importing nested module (#14946) 2024-12-16 16:15:40 -05:00
node_key.rs [red-knot] Use memory address as AST node key (#14317) 2024-11-13 14:35:54 +01:00
program.rs [red-knot] Support custom typeshed Markdown tests (#15683) 2025-01-23 12:36:38 +01:00
python_platform.rs Remove workspace support (#15472) 2025-01-15 09:03:38 +01:00
python_version.rs Add tracing support to mdtest (#14935) 2024-12-13 09:10:01 +00:00
semantic_index.rs [red-knot] Internal refactoring of visibility constraints API (#15913) 2025-02-03 15:13:09 -05:00
semantic_model.rs [red-knot] Rename *_ty functions (#15617) 2025-01-22 09:06:56 +01:00
site_packages.rs Rename `custom-typeshed-dir`, `target-version` and `current-directory` CLI options (#14930) 2024-12-13 08:21:52 +00:00
stdlib.rs [red-knot] Rename and rework the `CoreStdlibModule` enum (#15071) 2024-12-19 20:59:00 +00:00
suppression.rs [red-knot] Add `--ignore`, `--warn`, and `--error` CLI arguments (#15689) 2025-01-24 16:20:15 +01:00
symbol.rs [red-knot] Make `Symbol::or_fall_back_to()` lazy (#15943) 2025-02-05 14:51:02 +00:00
types.rs [red-knot] Fix some instance-attribute TODOs around `ModuleType` (#15974) 2025-02-05 15:33:37 +00:00
unpack.rs Allow assigning ellipsis literal as parameter default value (#14982) 2025-01-05 13:11:32 -06:00
visibility_constraints.rs [red-knot] Use ternary decision diagrams (TDDs) for visibility constraints (#15861) 2025-02-04 14:32:11 -05:00