-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
348112e
commit 3f1c449
Showing
15 changed files
with
165 additions
and
514 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 2 additions & 10 deletions
12
crates/ruff_fmt/test_data/black/cases/ignore_pyi.pyi.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,17 @@ | ||
def f(): # type: ignore | ||
... | ||
|
||
|
||
class x: # some comment | ||
... | ||
|
||
|
||
class y: | ||
... # comment | ||
|
||
class y: ... # comment | ||
|
||
# whitespace doesn't matter (note the next line has a trailing space and tab) | ||
class z: | ||
... | ||
|
||
class z: ... | ||
|
||
def g(): | ||
# hi | ||
... | ||
|
||
|
||
def h(): | ||
... | ||
# bye |
37 changes: 7 additions & 30 deletions
37
crates/ruff_fmt/test_data/black/cases/nested_stub.pyi.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,29 @@ | ||
import sys | ||
|
||
|
||
class Outer: | ||
class InnerStub: | ||
... | ||
|
||
class InnerStub: ... | ||
outer_attr_after_inner_stub: int | ||
|
||
class Inner: | ||
inner_attr: int | ||
|
||
outer_attr: int | ||
|
||
|
||
if sys.version_info > (3, 7): | ||
if sys.platform == "win32": | ||
assignment = 1 | ||
|
||
def function_definition(self): | ||
... | ||
|
||
def f1(self) -> str: | ||
... | ||
|
||
def function_definition(self): ... | ||
def f1(self) -> str: ... | ||
if sys.platform != "win32": | ||
|
||
def function_definition(self): | ||
... | ||
|
||
def function_definition(self): ... | ||
assignment = 1 | ||
|
||
def f2(self) -> str: | ||
... | ||
|
||
def f2(self) -> str: ... | ||
|
||
class TopLevel: | ||
class Nested1: | ||
foo: int | ||
|
||
def bar(self): | ||
... | ||
|
||
def bar(self): ... | ||
field = 1 | ||
|
||
class Nested2: | ||
def bar(self): | ||
... | ||
|
||
def bar(self): ... | ||
foo: int | ||
|
||
field = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,133 +1,63 @@ | ||
X: int | ||
|
||
def f(): ... | ||
|
||
def f(): | ||
... | ||
|
||
|
||
class D: | ||
... | ||
|
||
|
||
class C: | ||
... | ||
|
||
class D: ... | ||
class C: ... | ||
|
||
class B: | ||
this_lack_of_newline_should_be_kept: int | ||
|
||
def b(self) -> None: | ||
... | ||
def b(self) -> None: ... | ||
|
||
but_this_newline_should_also_be_kept: int | ||
|
||
|
||
class A: | ||
attr: int | ||
attr2: str | ||
|
||
def f(self) -> int: | ||
... | ||
|
||
def g(self) -> str: | ||
... | ||
|
||
|
||
def g(): | ||
... | ||
|
||
|
||
def h(): | ||
... | ||
def f(self) -> int: ... | ||
def g(self) -> str: ... | ||
|
||
def g(): ... | ||
def h(): ... | ||
|
||
if sys.version_info >= (3, 8): | ||
|
||
class E: | ||
def f(self): | ||
... | ||
|
||
def f(self): ... | ||
class F: | ||
def f(self): | ||
... | ||
|
||
class G: | ||
... | ||
|
||
class H: | ||
... | ||
def f(self): ... | ||
class G: ... | ||
class H: ... | ||
else: | ||
|
||
class I: | ||
... | ||
|
||
class J: | ||
... | ||
|
||
def f(): | ||
... | ||
class I: ... | ||
class J: ... | ||
def f(): ... | ||
|
||
class K: | ||
def f(self): | ||
... | ||
|
||
def f(): | ||
... | ||
|
||
def f(self): ... | ||
def f(): ... | ||
|
||
class Nested: | ||
class dirty: | ||
... | ||
|
||
class little: | ||
... | ||
|
||
class dirty: ... | ||
class little: ... | ||
class secret: | ||
def who_has_to_know(self): | ||
... | ||
|
||
def verse(self): | ||
... | ||
|
||
def who_has_to_know(self): ... | ||
def verse(self): ... | ||
|
||
class Conditional: | ||
def f(self): | ||
... | ||
|
||
def f(self): ... | ||
if sys.version_info >= (3, 8): | ||
|
||
def g(self): | ||
... | ||
def g(self): ... | ||
else: | ||
|
||
def g(self): | ||
... | ||
|
||
def h(self): | ||
... | ||
|
||
def i(self): | ||
... | ||
|
||
def g(self): ... | ||
def h(self): ... | ||
def i(self): ... | ||
if sys.version_info >= (3, 8): | ||
|
||
def j(self): | ||
... | ||
|
||
def k(self): | ||
... | ||
|
||
def j(self): ... | ||
def k(self): ... | ||
if sys.version_info >= (3, 8): | ||
|
||
class A: | ||
... | ||
|
||
class B: | ||
... | ||
|
||
class A: ... | ||
class B: ... | ||
class C: | ||
def l(self): | ||
... | ||
|
||
def m(self): | ||
... | ||
def l(self): ... | ||
def m(self): ... |
51 changes: 12 additions & 39 deletions
51
crates/ruff_fmt/test_data/black/miscellaneous/force_pyi.pyi.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,31 @@ | ||
from typing import Union | ||
|
||
|
||
@bird | ||
def zoo(): | ||
... | ||
|
||
|
||
class A: | ||
... | ||
def zoo(): ... | ||
|
||
class A: ... | ||
|
||
@bar | ||
class B: | ||
def BMethod(self) -> None: | ||
... | ||
|
||
def BMethod(self) -> None: ... | ||
@overload | ||
def BMethod(self, arg: List[str]) -> None: | ||
... | ||
|
||
|
||
class C: | ||
... | ||
def BMethod(self, arg: List[str]) -> None: ... | ||
|
||
class C: ... | ||
|
||
@hmm | ||
class D: | ||
... | ||
|
||
|
||
class E: | ||
... | ||
|
||
class D: ... | ||
class E: ... | ||
|
||
@baz | ||
def foo() -> None: | ||
... | ||
|
||
|
||
class F(A, C): | ||
... | ||
|
||
|
||
def spam() -> None: | ||
... | ||
def foo() -> None: ... | ||
|
||
class F(A, C): ... | ||
|
||
def spam() -> None: ... | ||
@overload | ||
def spam(arg: str) -> str: | ||
... | ||
|
||
def spam(arg: str) -> str: ... | ||
|
||
var: int = 1 | ||
|
||
|
||
def eggs() -> Union[str, int]: | ||
... | ||
def eggs() -> Union[str, int]: ... |
Oops, something went wrong.