diff --git a/crates/ruff_python_formatter/tests/snapshots/black_compatibility@simple_cases__expression.py.snap b/crates/ruff_python_formatter/tests/snapshots/black_compatibility@simple_cases__expression.py.snap index b743d9c808527..b1edc138d912d 100644 --- a/crates/ruff_python_formatter/tests/snapshots/black_compatibility@simple_cases__expression.py.snap +++ b/crates/ruff_python_formatter/tests/snapshots/black_compatibility@simple_cases__expression.py.snap @@ -397,6 +397,9 @@ last_call() - int, - float, - dict[str, int], +-] +-very_long_variable_name_filters: t.List[ +- t.Tuple[str, t.Union[str, t.List[t.Optional[str]]]], + ( + str, + int, @@ -404,9 +407,6 @@ last_call() + dict[str, int], + ) ] --very_long_variable_name_filters: t.List[ -- t.Tuple[str, t.Union[str, t.List[t.Optional[str]]]], --] -xxxx_xxxxx_xxxx_xxx: Callable[..., List[SomeClass]] = classmethod( # type: ignore - sync(async_xxxx_xxx_xxxx_xxxxx_xxxx_xxx.__func__) -) @@ -506,7 +506,7 @@ last_call() Ø = set() authors.łukasz.say_thanks() mapping = { -@@ -237,29 +221,33 @@ +@@ -237,19 +221,23 @@ def gen(): @@ -527,11 +527,6 @@ last_call() -print(*[] or [1]) -print(**{1: 3} if False else {x: x for x in range(3)}) -print(*lambda x: x) --assert not Test, "Short message" --assert this is ComplexTest and not requirements.fit_in_a_single_line( -- force=False --), "Short message" --assert parens is TooMany +print(*NOT_YET_IMPLEMENTED_ExprStarred) +print( + **{1: 3} @@ -539,10 +534,10 @@ last_call() + else {NOT_IMPLEMENTED_dict_key: NOT_IMPLEMENTED_dict_value for key, value in NOT_IMPLEMENTED_dict} +) +print(*NOT_YET_IMPLEMENTED_ExprStarred) -+NOT_YET_IMPLEMENTED_StmtAssert -+NOT_YET_IMPLEMENTED_StmtAssert -+NOT_YET_IMPLEMENTED_StmtAssert - for (x,) in (1,), (2,), (3,): + assert not Test, "Short message" + assert this is ComplexTest and not requirements.fit_in_a_single_line( + force=False +@@ -259,7 +247,9 @@ ... for y in (): ... @@ -553,7 +548,7 @@ last_call() ... for i in call(): ... -@@ -328,13 +316,18 @@ +@@ -328,13 +318,18 @@ ): return True if ( @@ -575,7 +570,7 @@ last_call() ^ aaaaaaaa.i << aaaaaaaa.k >> aaaaaaaa.l**aaaaaaaa.m // aaaaaaaa.n ): return True -@@ -342,7 +335,8 @@ +@@ -342,7 +337,8 @@ ~aaaaaaaaaaaaaaaa.a + aaaaaaaaaaaaaaaa.b - aaaaaaaaaaaaaaaa.c * aaaaaaaaaaaaaaaa.d @ aaaaaaaaaaaaaaaa.e @@ -830,9 +825,11 @@ print( else {NOT_IMPLEMENTED_dict_key: NOT_IMPLEMENTED_dict_value for key, value in NOT_IMPLEMENTED_dict} ) print(*NOT_YET_IMPLEMENTED_ExprStarred) -NOT_YET_IMPLEMENTED_StmtAssert -NOT_YET_IMPLEMENTED_StmtAssert -NOT_YET_IMPLEMENTED_StmtAssert +assert not Test, "Short message" +assert this is ComplexTest and not requirements.fit_in_a_single_line( + force=False +), "Short message" +assert parens is TooMany for (x,) in (1,), (2,), (3,): ... for y in (): diff --git a/crates/ruff_python_formatter/tests/snapshots/black_compatibility@simple_cases__fmtonoff2.py.snap b/crates/ruff_python_formatter/tests/snapshots/black_compatibility@simple_cases__fmtonoff2.py.snap index abdfcb6d563f9..012dd71335b64 100644 --- a/crates/ruff_python_formatter/tests/snapshots/black_compatibility@simple_cases__fmtonoff2.py.snap +++ b/crates/ruff_python_formatter/tests/snapshots/black_compatibility@simple_cases__fmtonoff2.py.snap @@ -77,10 +77,10 @@ def test_calculate_fades(): + def check_fader(test): -+ pass - -- pass +- + pass ++ def verify_fader(test): - # misaligned comment + # misaligned comment @@ -89,10 +89,9 @@ def test_calculate_fades(): + def verify_fader(test): """Hey, ho.""" -- assert test.passed() -+ NOT_YET_IMPLEMENTED_StmtAssert -+ + assert test.passed() ++ def test_calculate_fades(): calcs = [ # one is zero/none @@ -141,7 +140,7 @@ def verify_fader(test): def verify_fader(test): """Hey, ho.""" - NOT_YET_IMPLEMENTED_StmtAssert + assert test.passed() def test_calculate_fades(): diff --git a/crates/ruff_python_formatter/tests/snapshots/black_compatibility@simple_cases__torture.py.snap b/crates/ruff_python_formatter/tests/snapshots/black_compatibility@simple_cases__torture.py.snap index 246fcc69bc0ee..56a0558ab7fd1 100644 --- a/crates/ruff_python_formatter/tests/snapshots/black_compatibility@simple_cases__torture.py.snap +++ b/crates/ruff_python_formatter/tests/snapshots/black_compatibility@simple_cases__torture.py.snap @@ -41,7 +41,7 @@ assert ( ```diff --- Black +++ Ruff -@@ -2,20 +2,10 @@ +@@ -2,7 +2,7 @@ ( () << 0 @@ -49,22 +49,8 @@ assert ( + **101234234242352525425252352352525234890264906820496920680926538059059209922523523525 ) # --assert sort_by_dependency( -- { -- "1": {"2", "3"}, -- "2": {"2a", "2b"}, -- "3": {"3a", "3b"}, -- "2a": set(), -- "2b": set(), -- "3a": set(), -- "3b": set(), -- } --) == ["2a", "2b", "2", "3a", "3b", "3", "1"] -+NOT_YET_IMPLEMENTED_StmtAssert - - importA - 0 -@@ -25,34 +15,33 @@ + assert sort_by_dependency( +@@ -25,30 +25,32 @@ class A: def foo(self): for _ in range(10): @@ -118,11 +104,6 @@ assert ( ) --assert a_function( -- very_long_arguments_that_surpass_the_limit, -- which_is_eighty_eight_in_this_case_plus_a_bit_more, --) == {"x": "this need to pass the line limit as well", "b": "but only by a little bit"} -+NOT_YET_IMPLEMENTED_StmtAssert ``` ## Ruff Output @@ -135,7 +116,17 @@ importA **101234234242352525425252352352525234890264906820496920680926538059059209922523523525 ) # -NOT_YET_IMPLEMENTED_StmtAssert +assert sort_by_dependency( + { + "1": {"2", "3"}, + "2": {"2a", "2b"}, + "3": {"3a", "3b"}, + "2a": set(), + "2b": set(), + "3a": set(), + "3b": set(), + } +) == ["2a", "2b", "2", "3a", "3b", "3", "1"] importA 0 @@ -174,7 +165,10 @@ def test(self, othr): ) -NOT_YET_IMPLEMENTED_StmtAssert +assert a_function( + very_long_arguments_that_surpass_the_limit, + which_is_eighty_eight_in_this_case_plus_a_bit_more, +) == {"x": "this need to pass the line limit as well", "b": "but only by a little bit"} ``` ## Black Output