ruff/crates
David Peter a90e404c3f
[red-knot] PEP 695 type aliases (#14357)
## Summary

Add support for (non-generic) type aliases. The main motivation behind
this was to get rid of panics involving expressions in (generic) type
aliases. But it turned out the best way to fix it was to implement
(partial) support for type aliases.

```py
type IntOrStr = int | str

reveal_type(IntOrStr)  # revealed: typing.TypeAliasType
reveal_type(IntOrStr.__name__)  # revealed: Literal["IntOrStr"]

x: IntOrStr = 1

reveal_type(x)  # revealed: Literal[1]

def f() -> None:
    reveal_type(x)  # revealed: int | str
```

## Test Plan

- Updated corpus test allow list to reflect that we don't panic anymore.
- Added Markdown-based test for type aliases (`type_alias.md`)
2024-11-22 08:47:14 +01:00
..
red_knot Add tests for python version compatibility (#14430) 2024-11-18 12:26:55 +00:00
red_knot_python_semantic [red-knot] PEP 695 type aliases (#14357) 2024-11-22 08:47:14 +01:00
red_knot_server
red_knot_test [red-knot] Improve mdtest output (#14213) 2024-11-11 11:03:41 +00:00
red_knot_vendored
red_knot_wasm Add tests for python version compatibility (#14430) 2024-11-18 12:26:55 +00:00
red_knot_workspace [red-knot] PEP 695 type aliases (#14357) 2024-11-22 08:47:14 +01:00
ruff Ruff 0.8 release (#14486) 2024-11-22 08:45:19 +01:00
ruff_benchmark Fix Red Knot benchmarks on Windows (#14400) 2024-11-17 16:21:09 +00:00
ruff_cache
ruff_db Update insta snapshots (#14366) 2024-11-15 19:31:15 +01:00
ruff_dev
ruff_diagnostics
ruff_formatter
ruff_graph
ruff_index
ruff_linter Ruff 0.8 release (#14486) 2024-11-22 08:45:19 +01:00
ruff_macros [ruff 0.8] [flake8-pytest-style] Remove deprecated rules PT004 and PT005 (#14385) 2024-11-20 13:11:51 +01:00
ruff_notebook
ruff_python_ast
ruff_python_ast_integration_tests Update insta snapshots (#14366) 2024-11-15 19:31:15 +01:00
ruff_python_codegen
ruff_python_formatter Change default for Python version from 3.8 to 3.9 (#13896) 2024-11-20 13:11:51 +01:00
ruff_python_index
ruff_python_literal Use bitshift consistently for bitflag definitions (#14265) 2024-11-11 10:20:17 +00:00
ruff_python_parser Update insta snapshots (#14366) 2024-11-15 19:31:15 +01:00
ruff_python_resolver Update insta snapshots (#14366) 2024-11-15 19:31:15 +01:00
ruff_python_semantic [pycodestyle] Exempt pytest.importorskip() calls (E402) (#14474) 2024-11-19 22:08:15 -05:00
ruff_python_stdlib
ruff_python_trivia
ruff_python_trivia_integration_tests Update insta snapshots (#14366) 2024-11-15 19:31:15 +01:00
ruff_server Update insta snapshots (#14366) 2024-11-15 19:31:15 +01:00
ruff_source_file
ruff_text_size
ruff_wasm Ruff 0.8 release (#14486) 2024-11-22 08:45:19 +01:00
ruff_workspace [flake8-import-conventions] Syntax check aliases supplied in configuration for unconventional-import-alias (ICN001) (#14477) 2024-11-21 15:54:49 +00:00