mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 02:38:25 +00:00
Import Black's type aliases test (#9456)
This commit is contained in:
parent
58fcd96ac1
commit
79f4abbb8d
4 changed files with 26 additions and 3 deletions
1
crates/ruff_python_formatter/resources/test/fixtures/black/cases/type_aliases.options.json
vendored
Normal file
1
crates/ruff_python_formatter/resources/test/fixtures/black/cases/type_aliases.options.json
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"target_version": "py312"}
|
10
crates/ruff_python_formatter/resources/test/fixtures/black/cases/type_aliases.py
vendored
Normal file
10
crates/ruff_python_formatter/resources/test/fixtures/black/cases/type_aliases.py
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
type A=int
|
||||
type Gen[T]=list[T]
|
||||
type Alias[T]=lambda: T
|
||||
type And[T]=T and T
|
||||
type IfElse[T]=T if T else T
|
||||
type One = int; type Another = str
|
||||
class X: type InClass = int
|
||||
|
||||
type = aliased
|
||||
print(type(42))
|
15
crates/ruff_python_formatter/resources/test/fixtures/black/cases/type_aliases.py.expect
vendored
Normal file
15
crates/ruff_python_formatter/resources/test/fixtures/black/cases/type_aliases.py.expect
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
type A = int
|
||||
type Gen[T] = list[T]
|
||||
type Alias[T] = lambda: T
|
||||
type And[T] = T and T
|
||||
type IfElse[T] = T if T else T
|
||||
type One = int
|
||||
type Another = str
|
||||
|
||||
|
||||
class X:
|
||||
type InClass = int
|
||||
|
||||
|
||||
type = aliased
|
||||
print(type(42))
|
|
@ -96,9 +96,6 @@ IGNORE_LIST = [
|
|||
|
||||
# Uses a different output format
|
||||
"decorators.py",
|
||||
|
||||
# Ruff fails to parse because of a parser bug
|
||||
"type_aliases.py" # #8900 #8899
|
||||
]
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue