ruff/crates
David Peter 5e64863895
[red-knot] Handle invalid assignment targets (#14325)
## Summary

This fixes several panics related to invalid assignment targets. All of
these led to some a crash, previously:
```py
(x.y := 1)  # only name-expressions are valid targets of named expressions
([x, y] := [1, 2])  # same
(x, y): tuple[int, int] = (2, 3)  # tuples are not valid targets for annotated assignments
(x, y) += 2  # tuples are not valid targets for augmented assignments
```

closes #14321
closes #14322

## Test Plan

I symlinked four files from `crates/ruff_python_parser/resources` into
the red knot corpus, as they seemed like ideal test files for this exact
scenario. I think eventually, it might be a good idea to simply include *all*
invalid-syntax examples from the parser tests into red knots corpus (I believe
we're actually not too far from that goal). Or expand the scope of the corpus
test to this directory. Then we can get rid of these symlinks again.
2024-11-13 20:50:39 +01:00
..
red_knot Introduce Diagnostic trait (#14130) 2024-11-07 13:26:21 +01:00
red_knot_python_semantic [red-knot] Handle invalid assignment targets (#14325) 2024-11-13 20:50:39 +01:00
red_knot_server Introduce Diagnostic trait (#14130) 2024-11-07 13:26:21 +01:00
red_knot_test [red-knot] Improve mdtest output (#14213) 2024-11-11 11:03:41 +00:00
red_knot_vendored Sync vendored typeshed stubs (#14030) 2024-11-01 10:51:56 +00:00
red_knot_wasm Introduce Diagnostic trait (#14130) 2024-11-07 13:26:21 +01:00
red_knot_workspace [red-knot] Handle invalid assignment targets (#14325) 2024-11-13 20:50:39 +01:00
ruff [flake8-markupsafe] Adds Implementation for MS001 via RUF035 (#14224) 2024-11-11 18:30:03 +00:00
ruff_benchmark Introduce Diagnostic trait (#14130) 2024-11-07 13:26:21 +01:00
ruff_cache Fix cache key collisions for paths with separators (#12159) 2024-07-03 07:36:46 -05:00
ruff_db Introduce Diagnostic trait (#14130) 2024-11-07 13:26:21 +01:00
ruff_dev Alternate quotes for strings inside f-strings in preview (#13860) 2024-10-23 07:57:53 +02:00
ruff_diagnostics Document comment policy around fix safety (#14300) 2024-11-13 08:03:58 -05:00
ruff_formatter Join implicit concatenated strings when they fit on a line (#13663) 2024-10-24 11:52:22 +02:00
ruff_graph Bump MSRV to Rust 1.80 (#13826) 2024-10-20 10:55:36 +02:00
ruff_index [red-knot] small efficiency improvements and bugfixes to use-def map building (#12373) 2024-07-18 09:24:58 -07:00
ruff_linter Remove unused flags and functions from the semantic model (#14318) 2024-11-13 17:35:48 +00:00
ruff_macros Derive message formats macro support to string (#14093) 2024-11-04 18:06:25 +01:00
ruff_notebook Bump MSRV to Rust 1.80 (#13826) 2024-10-20 10:55:36 +02:00
ruff_python_ast [flake8-simplify] Infer "unknown" truthiness for literal iterables whose items are all unpacks (SIM222) (#14263) 2024-11-11 15:23:34 -05:00
ruff_python_ast_integration_tests [internal] ComparableExpr (f)strings and bytes made invariant under concatenation (#13301) 2024-09-25 16:58:57 +02:00
ruff_python_codegen Extract LineIndex independent methods from Locator (#13938) 2024-10-28 07:53:41 +00:00
ruff_python_formatter Disallow single-line implicit concatenated strings (#13928) 2024-11-03 11:49:26 +00:00
ruff_python_index Extract LineIndex independent methods from Locator (#13938) 2024-10-28 07:53:41 +00:00
ruff_python_literal Use bitshift consistently for bitflag definitions (#14265) 2024-11-11 10:20:17 +00:00
ruff_python_parser Short circuit lex_identifier if the name is longer or shorter than any known keyword (#13815) 2024-10-19 11:07:15 +00:00
ruff_python_resolver chore(deps): update rust crate insta to v1.38.0 (#10701) 2024-04-01 15:44:30 +00:00
ruff_python_semantic Remove unused flags and functions from the semantic model (#14318) 2024-11-13 17:35:48 +00:00
ruff_python_stdlib Use bitshift consistently for bitflag definitions (#14265) 2024-11-11 10:20:17 +00:00
ruff_python_trivia Extract LineIndex independent methods from Locator (#13938) 2024-10-28 07:53:41 +00:00
ruff_python_trivia_integration_tests Extract LineIndex independent methods from Locator (#13938) 2024-10-28 07:53:41 +00:00
ruff_server Detect empty implicit namespace packages (#14236) 2024-11-09 22:03:34 -05:00
ruff_source_file Extract LineIndex independent methods from Locator (#13938) 2024-10-28 07:53:41 +00:00
ruff_text_size Extract LineIndex independent methods from Locator (#13938) 2024-10-28 07:53:41 +00:00
ruff_wasm Bump version to 0.7.3 (#14197) 2024-11-08 16:39:37 +05:30
ruff_workspace [flake8-markupsafe] Adds Implementation for MS001 via RUF035 (#14224) 2024-11-11 18:30:03 +00:00