mirror of
https://github.com/astral-sh/ruff
synced 2026-01-08 23:24:31 -05:00
Add rule to upgrade type alias annotations to keyword (UP040) (#6289)
Adds rule to convert type aliases defined with annotations i.e. `x: TypeAlias = int` to the new PEP-695 syntax e.g. `type x = int`. Does not support using new generic syntax for type variables, will be addressed in a follow-up. Added as part of pyupgrade — ~the code 100 as chosen to avoid collision with real pyupgrade codes~. Part of #4617 Builds on #5062
This commit is contained in:
@@ -82,6 +82,7 @@ KNOWN_PARSE_ERRORS = [
|
||||
"missing-newline-at-end-of-file",
|
||||
"mixed-spaces-and-tabs",
|
||||
"no-indented-block",
|
||||
"non-pep695-type-alias", # requires Python 3.12
|
||||
"tab-after-comma",
|
||||
"tab-after-keyword",
|
||||
"tab-after-operator",
|
||||
|
||||
Reference in New Issue
Block a user