Skip to content

chore(deps): update rust crate serde_json to v1.0.138 #522

chore(deps): update rust crate serde_json to v1.0.138

chore(deps): update rust crate serde_json to v1.0.138 #522

Triggered via push January 28, 2025 21:33
Status Failure
Total duration 1m 46s
Artifacts 1

test.yml

on: push
Fit to window
Zoom out
Zoom in

Annotations

13 errors
Cargo test
Process completed with exit code 101.
error: expect(received).toBe(expected): crates/ruff_fmt/test_bun/bun.spec.ts#L23
Expected: "x = {\"a\": 37, \"b\": 42, \"c\": 927}\n\ny = \"hello world\"\nz = \"hello \" + \"world\"\na = \"hello {}\".format(\"world\")\n\n\nclass foo(object):\n def f(self):\n return 37 * -+2\n\n def g(self, x, y=42):\n return y\n\n\ndef f(a):\n return 37 + -+a[42 - x : y**3]\n" Received: "x = {\"a\": 37, \"b\": 42, \"c\": 927}\n\ny = \"hello \" \"world\"\nz = \"hello \" + \"world\"\na = \"hello {}\".format(\"world\")\n\n\nclass foo(object):\n def f(self):\n return 37 * -+2\n\n def g(self, x, y=42):\n return y\n\n\ndef f(a):\n return 37 + -+a[42 - x : y**3]\n" at <anonymous> (/home/runner/work/ruff_fmt/ruff_fmt/crates/ruff_fmt/test_bun/bun.spec.ts:23:24)
error: expect(received).toBe(expected): crates/ruff_fmt/test_bun/bun.spec.ts#L23
Expected: "def foo(e):\n f\"\"\" {\".\".join(e)}\"\"\"\n\n\ndef bar(e):\n f\"{'.'.join(e)}\"\n\n\ndef baz(e):\n f\"\"\" {\".\".join(e)}\"\"\"\n" Received: "def foo(e):\n f\"\"\" {'.'.join(e)}\"\"\"\n\n\ndef bar(e):\n f\"{'.'.join(e)}\"\n\n\ndef baz(e):\n f\"\"\" {'.'.join(e)}\"\"\"\n" at <anonymous> (/home/runner/work/ruff_fmt/ruff_fmt/crates/ruff_fmt/test_bun/bun.spec.ts:23:24)
error: expect(received).toBe(expected): crates/ruff_fmt/test_bun/bun.spec.ts#L23
Expected: "if foo := 0:\n pass\n\nif foo := 1:\n pass\n\nif y := 5 + 5:\n pass\n\ny = (x := 0)\n\ny += (x := 0)\n\n(y := 5 + 5)\n\ntest: int = (test2 := 2)\n\na, b = (test := (1, 2))\n\n# see also https://github.com/psf/black/issues/2139\nassert (foo := 42 - 12)\n\nfoo(x=(y := f(x)))\n\n\ndef foo(answer=(p := 42)): ...\n\n\ndef foo2(answer: (p := 42) = 5): ...\n\n\nlambda: (x := 1)\n\na[(x := 12)]\na[: (x := 13)]\n\n# we don't touch expressions in f-strings but if we do one day, don't break 'em\nf\"{(x := 10)}\"\n\n\ndef a():\n return (x := 3)\n await (b := 1)\n yield (a := 2)\n raise (c := 3)\n\n\ndef this_is_so_dumb() -> (please := no):\n pass\n\n\nasync def await_the_walrus():\n with (x := y):\n pass\n\n with (x := y) as z, (a := b) as c:\n pass\n\n with (x := await y):\n pass\n\n with (x := await a, y := await b):\n pass\n\n with (x := await a, y := await b):\n pass\n\n with (x := await a), (y := await b):\n pass\n" Received: "if foo := 0:\n pass\n\nif foo := 1:\n pass\n\nif y := 5 + 5:\n pass\n\ny = (x := 0)\n\ny += (x := 0)\n\n(y := 5 + 5)\n\ntest: int = (test2 := 2)\n\na, b = (test := (1, 2))\n\n# see also https://github.com/psf/black/issues/2139\nassert (foo := 42 - 12)\n\nfoo(x=(y := f(x)))\n\n\ndef foo(answer=(p := 42)): ...\n\n\ndef foo2(answer: (p := 42) = 5): ...\n\n\nlambda: (x := 1)\n\na[(x := 12)]\na[: (x := 13)]\n\n# we don't touch expressions in f-strings but if we do one day, don't break 'em\nf\"{(x:=10)}\"\n\n\ndef a():\n return (x := 3)\n await (b := 1)\n yield (a := 2)\n raise (c := 3)\n\n\ndef this_is_so_dumb() -> (please := no):\n pass\n\n\nasync def await_the_walrus():\n with (x := y):\n pass\n\n with (x := y) as z, (a := b) as c:\n pass\n\n with (x := await y):\n pass\n\n with (x := await a, y := await b):\n pass\n\n with (x := await a, y := await b):\n pass\n\n with (x := await a), (y := await b):\n pass\n" at <anonymous> (/home/runner/work/ruff_fmt/ruff_fmt/crates/ruff_fmt/test_bun/bun.spec.ts:23:24)
error: expect(received).toBe(expected): crates/ruff_fmt/test_bun/bun.spec.ts#L23
Expected: "class C:\n def test(self) -> None:\n with patch(\"black.out\", print):\n self.assertEqual(\n unstyle(str(report)), \"1 file reformatted, 1 file failed to reformat.\"\n )\n self.assertEqual(\n unstyle(str(report)),\n \"1 file reformatted, 1 file left unchanged, 1 file failed to reformat.\",\n )\n self.assertEqual(\n unstyle(str(report)),\n \"2 files reformatted, 1 file left unchanged, 1 file failed to\"\n \" reformat.\",\n )\n self.assertEqual(\n unstyle(str(report)),\n \"2 files reformatted, 2 files left unchanged, 2 files failed to\"\n \" reformat.\",\n )\n for i in (a,):\n if (\n # Rule 1\n i % 2 == 0\n # Rule 2\n and i % 3 == 0\n ):\n while (\n # Just a comment\n call()\n # Another\n ):\n print(i)\n xxxxxxxxxxxxxxxx = Yyyy2YyyyyYyyyyy(\n push_manager=context.request.resource_manager,\n max_items_to_push=num_items,\n batch_size=Yyyy2YyyyYyyyyYyyy.FULL_SIZE,\n ).push(\n # Only send the first n items.\n items=items[:num_items]\n )\n return (\n 'Utterly failed doctest test for %s\\n File \"%s\", line %s, in %s\\n\\n%s'\n % (test.name, test.filename, lineno, lname, err)\n )\n\n def omitting_trailers(self) -> None:\n get_collection(\n hey_this_is_a_very_long_call, it_has_funny_attributes, really=True\n )[OneLevelIndex]\n get_collection(\n hey_this_is_a_very_long_call, it_has_funny_attributes, really=True\n )[OneLevelIndex][TwoLevelIndex][ThreeLevelIndex][FourLevelIndex]\n d[0][1][2][3][4][5][6][7][8][9][10][11][12][13][14][15][16][17][18][19][20][21][\n 22\n ]\n assignment = (\n some.rather.elaborate.rule() and another.rule.ending_with.index[123]\n )\n\n def easy_asserts(self) -> None:\n assert {\n key1: value1,\n key2: value2,\n key3: value3,\n key4: value4,\n key5: value5,\n key6: value6,\n key7: value7,\n key8: value8,\n key9: value9,\n } == expected, \"Not what we expected\"\n\n assert expected == {\n key1: value1,\n key2: value2,\n key3: value3,\n key4: value4,\n key5: value5,\n key6: value6,\n key7: value7,\n key8: value8,\n key9: value9,\n }, \"Not what we expected\"\n\n assert expected == {\n key1: value1,\n key2: value2,\n key3: value3,\n key4: value4,\n key5: value5,\n key6: value6,\n key7: value7,\n key8: value8,\n key9: value9,\n }\n\n def tricky_asserts(self) -> None:\n assert {\n key1: value1,\n key2: value2,\n key3: value3,\n key4: value4,\n key5: value5,\n key6: value6,\n key7: value7,\n key8: value8,\n key9: value9,\n } == expected(\n value, is_going_to_be=\"too long to fit in a single line\", srsly=True\n ), \"Not what we expected\"\n\n assert {\n key1: value1,\n key2: value2,\n key3: value3,\n key4: value4,\n key5: value5,\n key6: value6,\n key7: value7,\n key8: value8,\n key9: value9,\n } == expected, (\n \"Not what we expected and the message is too long to fit in one line\"\n )\n\n assert expected(\n
error: expect(received).toBe(expected): crates/ruff_fmt/test_bun/bun.spec.ts#L23
Expected: "# normal, short, function definition\ndef foo(a, b) -> tuple[int, float]: ...\n\n\n# normal, short, function definition w/o return type\ndef foo(a, b): ...\n\n\n# no splitting\ndef foo(a: A, b: B) -> list[p, q]:\n pass\n\n\n# magic trailing comma in param list\ndef foo(\n a,\n b,\n): ...\n\n\n# magic trailing comma in nested params in param list\ndef foo(\n a,\n b: tuple[\n int,\n float,\n ],\n): ...\n\n\n# magic trailing comma in return type, no params\ndef a() -> tuple[\n a,\n b,\n]: ...\n\n\n# magic trailing comma in return type, params\ndef foo(\n a: A, b: B\n) -> list[\n p,\n q,\n]:\n pass\n\n\n# magic trailing comma in param list and in return type\ndef foo(\n a: a,\n b: b,\n) -> list[\n a,\n a,\n]:\n pass\n\n\n# long function definition, param list is longer\ndef aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(\n bbbbbbbbbbbbbbbbbb,\n) -> cccccccccccccccccccccccccccccc: ...\n\n\n# long function definition, return type is longer\n# this should maybe split on rhs?\ndef aaaaaaaaaaaaaaaaa(\n bbbbbbbbbbbbbbbbbb,\n) -> list[Ccccccccccccccccccccccccccccccccccccccccccccccccccc, Dddddd]: ...\n\n\n# long return type, no param list\ndef foo() -> list[\n Loooooooooooooooooooooooooooooooooooong,\n Loooooooooooooooooooong,\n Looooooooooooong,\n]: ...\n\n\n# long function name, no param list, no return value\ndef thiiiiiiiiiiiiiiiiiis_iiiiiiiiiiiiiiiiiiiiiiiiiiiiiis_veeeeeeeeeeeeeeeeeeeeeeery_looooooong():\n pass\n\n\n# long function name, no param list\ndef thiiiiiiiiiiiiiiiiiis_iiiiiiiiiiiiiiiiiiiiiiiiiiiiiis_veeeeeeeeeeeeeeeeeeeeeeery_looooooong() -> (\n list[int, float]\n): ...\n\n\n# long function name, no return value\ndef thiiiiiiiiiiiiiiiiiis_iiiiiiiiiiiiiiiiiiiiiiiiiiiiiis_veeeeeeeeeeeeeeeeeeeeeeery_looooooong(\n a, b\n): ...\n\n\n# unskippable type hint (??)\ndef foo(\n a,\n) -> list[\n aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n]: # type: ignore\n pass\n\n\ndef foo(\n a,\n) -> list[\n aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n]: # abpedeifnore\n pass\n\n\ndef foo(\n a,\n b: list[Bad],\n): ... # type: ignore\n\n\n# don't lose any comments (no magic)\ndef foo( # 1\n a, # 2\n b,\n) -> list[ # 3\n a, # 4\n b,\n]: # 5\n ... # 6\n\n\n# don't lose any comments (param list magic)\ndef foo( # 1\n a, # 2\n b,\n) -> list[ # 3\n a, # 4\n b,\n]: # 5\n ... # 6\n\n\n# don't lose any comments (return type magic)\ndef foo( # 1\n a, # 2\n b,\n) -> list[ # 3\n a, # 4\n b,\n]: # 5\n ... # 6\n\n\n# don't lose any comments (both magic)\ndef foo( # 1\n a, # 2\n b,\n) -> list[ # 3\n a, # 4\n b,\n]: # 5\n ... # 6\n\n\n# real life example\ndef SimplePyFn(\n context: hl.GeneratorContext,\n buffer_input: Buffer[UInt8, 2],\n func_input: Buffer[Int32, 2],\n float_arg: Scalar[Float32],\n offset: int = 0,\n) -> tuple[\n Buffer[UInt8, 2],\n Buffer[UInt8, 2],\n]: ...\n" Received: "# normal, short, function definition\ndef foo(a, b) -> tuple[int, float]: ...\n\n\n# normal, short, function definition w/o return type\ndef foo(a, b): ...\n\n\n# no splitting\ndef foo(a: A, b: B) -> list[p, q]:\n pass\n\n\n# magic trailing comma in param list\ndef foo(\n a,\n b,\n): ...\n\n\n# magic trailing comma in nested params in param list\ndef foo(\n a,\n b: tuple[\n int,\n float,\n ],\n): ...\n\n\n# magic trailing comma in return type, no params\ndef a() -> (\n tuple[\n a,\n b,\n ]\n): ...\n\n\n# magic trailing comma in return type, params\ndef foo(\n a: A, b: B\n) -> list[\n p,\n q,\n]:\n pass\n\n\n# magic trailing comma in param list and in return type\ndef foo(\n a: a,\n b: b,\n) -> list[\n a,\n a,\n]:\n pass\n\n\n# long function definition, param list is longer\ndef aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(\n bbbbbbbbbbbbbbbbbb,\n) -> cccccccccccccccccccccccccccccc: ...\n\n\n# long func
error: expect(received).toBe(expected): crates/ruff_fmt/test_bun/bun.spec.ts#L23
Expected: "f\"f-string without formatted values is just a string\"\nf\"{{NOT a formatted value}}\"\nf'{{NOT \\'a\\' \"formatted\" \"value\"}}'\nf\"some f-string with {a} {few():.2f} {formatted.values!r}\"\nf\"some f-string with {a} {few(''):.2f} {formatted.values!r}\"\nf\"{f'''{\"nested\"} inner'''} outer\"\nf'\"{f\"{nested} inner\"}\" outer'\nf\"space between opening braces: { {a for a in (1, 2, 3)} }\"\nf\"Hello '{tricky + 'example'}'\"\nf\"Tried directories {str(rootdirs)} \\\nbut none started with prefix {parentdir_prefix}\"\n" Received: "f\"f-string without formatted values is just a string\"\nf\"{{NOT a formatted value}}\"\nf'{{NOT \\'a\\' \"formatted\" \"value\"}}'\nf\"some f-string with {a} {few():.2f} {formatted.values!r}\"\nf'some f-string with {a} {few(\"\"):.2f} {formatted.values!r}'\nf\"{f'''{'nested'} inner'''} outer\"\nf\"\\\"{f'{nested} inner'}\\\" outer\"\nf\"space between opening braces: { {a for a in (1, 2, 3)}}\"\nf'Hello \\'{tricky + \"example\"}\\''\nf\"Tried directories {str(rootdirs)} \\\nbut none started with prefix {parentdir_prefix}\"\n" at <anonymous> (/home/runner/work/ruff_fmt/ruff_fmt/crates/ruff_fmt/test_bun/bun.spec.ts:23:24)
error: expect(received).toBe(expected): crates/ruff_fmt/test_bun/bun.spec.ts#L23
Expected: "def f(\n a,\n):\n d = {\n \"key\": \"value\",\n }\n tup = (1,)\n\n\ndef f2(\n a,\n b,\n):\n d = {\n \"key\": \"value\",\n \"key2\": \"value2\",\n }\n tup = (\n 1,\n 2,\n )\n\n\ndef f(\n a: int = 1,\n):\n call(\n arg={\n \"explode\": \"this\",\n }\n )\n call2(\n arg=[1, 2, 3],\n )\n x = {\n \"a\": 1,\n \"b\": 2,\n }[\"a\"]\n if (\n a\n == {\n \"a\": 1,\n \"b\": 2,\n \"c\": 3,\n \"d\": 4,\n \"e\": 5,\n \"f\": 6,\n \"g\": 7,\n \"h\": 8,\n }[\"a\"]\n ):\n pass\n\n\ndef xxxxxxxxxxxxxxxxxxxxxxxxxxxx() -> Set[\n \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n]:\n json = {\n \"k\": {\n \"k2\": {\n \"k3\": [\n 1,\n ]\n }\n }\n }\n\n\n# The type annotation shouldn't get a trailing comma since that would change its type.\n# Relevant bug report: https://github.com/psf/black/issues/2381.\ndef some_function_with_a_really_long_name() -> (\n returning_a_deeply_nested_import_of_a_type_i_suppose\n):\n pass\n\n\ndef some_method_with_a_really_long_name(\n very_long_parameter_so_yeah: str, another_long_parameter: int\n) -> another_case_of_returning_a_deeply_nested_import_of_a_type_i_suppose_cause_why_not:\n pass\n\n\ndef func() -> (\n also_super_long_type_annotation_that_may_cause_an_AST_related_crash_in_black(\n this_shouldn_t_get_a_trailing_comma_too\n )\n):\n pass\n\n\ndef func() -> (\n also_super_long_type_annotation_that_may_cause_an_AST_related_crash_in_black(\n this_shouldn_t_get_a_trailing_comma_too\n )\n):\n pass\n\n\n# Make sure inner one-element tuple won't explode\nsome_module.some_function(\n argument1, (one_element_tuple,), argument4, argument5, argument6\n)\n\n# Inner trailing comma causes outer to explode\nsome_module.some_function(\n argument1,\n (\n one,\n two,\n ),\n argument4,\n argument5,\n argument6,\n)\n" Received: "def f(\n a,\n):\n d = {\n \"key\": \"value\",\n }\n tup = (1,)\n\n\ndef f2(\n a,\n b,\n):\n d = {\n \"key\": \"value\",\n \"key2\": \"value2\",\n }\n tup = (\n 1,\n 2,\n )\n\n\ndef f(\n a: int = 1,\n):\n call(\n arg={\n \"explode\": \"this\",\n }\n )\n call2(\n arg=[1, 2, 3],\n )\n x = {\n \"a\": 1,\n \"b\": 2,\n }[\"a\"]\n if (\n a\n == {\n \"a\": 1,\n \"b\": 2,\n \"c\": 3,\n \"d\": 4,\n \"e\": 5,\n \"f\": 6,\n \"g\": 7,\n \"h\": 8,\n }[\"a\"]\n ):\n pass\n\n\ndef xxxxxxxxxxxxxxxxxxxxxxxxxxxx() -> (\n Set[\"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"]\n):\n json = {\n \"k\": {\n \"k2\": {\n \"k3\": [\n 1,\n ]\n }\n }\n }\n\n\n# The type annotation shouldn't get a trailing comma since that would change its type.\n# Relevant bug report: https://github.com/psf/black/issues/2381.\ndef some_function_with_a_really_long_name() -> (\n returning_a_deeply_nested_import_of_a_type_i_suppose\n):\n pass\n\n\ndef some_method_with_a_really_long_name(\n very_long_parameter_so_yeah: str, another_long_parameter: int\n) -> another_case_of_returning_a_deeply_nested_import_of_a_type_i_suppose_cause_why_not:\n pass\n\n\ndef func() -> (\n also_super_long_type_annotation_that_may_cause_an_AST_related_crash_in_black(\n this_shouldn_t_get_a_trailing_comma_too\n )\n):\n pass\n\n\ndef func() -> (\n also_super_long_type_annotation_that_may_cause_an_AST_related_crash_in_black(\n this_shouldn_t_get_a_trailing_comma_too\n )\n):\n pass\n\n\n# Make sure inner one-element tuple won't explode\nsome_modu
error: expect(received).toBe(expected): crates/ruff_fmt/test_bun/bun.spec.ts#L23
Expected: "(\n \"\"\"cow\nsay\"\"\",\n)\ncall(\n 3,\n \"dogsay\",\n textwrap.dedent(\n \"\"\"dove\n coo\"\"\"\n % \"cowabunga\"\n ),\n)\ncall(\n 3,\n \"dogsay\",\n textwrap.dedent(\n \"\"\"dove\ncoo\"\"\"\n % \"cowabunga\"\n ),\n)\ncall(\n 3,\n textwrap.dedent(\n \"\"\"cow\n moo\"\"\"\n % \"cowabunga\"\n ),\n \"dogsay\",\n)\ncall(\n 3,\n \"dogsay\",\n textwrap.dedent(\n \"\"\"crow\n caw\"\"\"\n % \"cowabunga\"\n ),\n)\ncall(\n 3,\n textwrap.dedent(\n \"\"\"cat\n meow\"\"\"\n % \"cowabunga\"\n ),\n {\"dog\", \"say\"},\n)\ncall(\n 3,\n {\"dog\", \"say\"},\n textwrap.dedent(\n \"\"\"horse\n neigh\"\"\"\n % \"cowabunga\"\n ),\n)\ncall(\n 3,\n {\"dog\", \"say\"},\n textwrap.dedent(\n \"\"\"pig\n oink\"\"\"\n % \"cowabunga\"\n ),\n)\ntextwrap.dedent(\"\"\"A one-line triple-quoted string.\"\"\")\ntextwrap.dedent(\"\"\"A two-line triple-quoted string\nsince it goes to the next line.\"\"\")\ntextwrap.dedent(\"\"\"A three-line triple-quoted string\nthat not only goes to the next line\nbut also goes one line beyond.\"\"\")\ntextwrap.dedent(\"\"\"\\\n A triple-quoted string\n actually leveraging the textwrap.dedent functionality\n that ends in a trailing newline,\n representing e.g. file contents.\n\"\"\")\npath.write_text(\n textwrap.dedent(\"\"\"\\\n A triple-quoted string\n actually leveraging the textwrap.dedent functionality\n that ends in a trailing newline,\n representing e.g. file contents.\n\"\"\")\n)\npath.write_text(\n textwrap.dedent(\n \"\"\"\\\n A triple-quoted string\n actually leveraging the textwrap.dedent functionality\n that ends in a trailing newline,\n representing e.g. {config_filename} file contents.\n\"\"\".format(\"config_filename\", config_filename)\n )\n)\n# Another use case\ndata = yaml.load(\"\"\"\\\na: 1\nb: 2\n\"\"\")\ndata = yaml.load(\n \"\"\"\\\na: 1\nb: 2\n\"\"\",\n)\ndata = yaml.load(\n \"\"\"\\\n a: 1\n b: 2\n\"\"\"\n)\n\nMULTILINE = \"\"\"\nfoo\n\"\"\".replace(\"\\n\", \"\")\ngenerated_readme = (\n lambda project_name: \"\"\"\n{}\n\n<Add content here!>\n\"\"\".strip().format(project_name)\n)\nparser.usage += \"\"\"\nCustom extra help summary.\n\nExtra test:\n- with\n- bullets\n\"\"\"\n\n\ndef get_stuff(cr, value):\n # original\n cr.execute(\n \"\"\"\n SELECT whatever\n FROM some_table t\n WHERE id = %s\n \"\"\",\n [value],\n )\n return cr.fetchone()\n\n\ndef get_stuff(cr, value):\n # preferred\n cr.execute(\n \"\"\"\n SELECT whatever\n FROM some_table t\n WHERE id = %s\n \"\"\",\n [value],\n )\n return cr.fetchone()\n\n\ncall(\n arg1,\n arg2,\n \"\"\"\nshort\n\"\"\",\n arg3=True,\n)\ntest_vectors = [\n \"one-liner\\n\",\n \"two\\nliner\\n\",\n \"\"\"expressed\nas a three line\nmulitline string\"\"\",\n]\n\n_wat = re.compile(\n r\"\"\"\n regex\n \"\"\",\n re.MULTILINE | re.VERBOSE,\n)\ndis_c_instance_method = \"\"\"\\\n%3d 0 LOAD_FAST 1 (x)\n 2 LOAD_CONST 1 (1)\n 4 COMPARE_OP 2 (==)\n 6 LOAD_FAST 0 (self)\n 8 STORE_ATTR 0 (x)\n 10 LOAD_CONST 0 (None)\n 12 RETURN_VALUE\n\"\"\" % (_C.__init__.__code__.co_firstlineno + 1,)\npath.write_text(\n textwrap.dedent(\n \"\"\"\\\n A triple-quoted string\n actually {verb} the textwrap.dedent functionality\n that ends in a trailing newline,\n representing e.g. {file_type} file contents.\n\"\"\".format(verb=\"using\", file_type=\"test\")\n )\n)\n{\n \"\"\"cow\nmoos\"\"\"\n}\n[\n \"\"\"cow\nmoos\"\"\"\n]\n[\n \"\"\"cow\nmoos\"\"\",\n \"\"\"dog\nwoofs\nand\nbarks\"\"\",\n]\n\n\ndef dastardly_default_value(\n cow: String = json.loads(\"\"\"this\nis\nq
error: expect(received).toBe(expected): crates/ruff_fmt/test_bun/bun.spec.ts#L23
Expected: "# Cases sampled from Lib/test/test_patma.py\n\n# case black_test_patma_098\nmatch x:\n case -0j:\n y = 0\n# case black_test_patma_142\nmatch x:\n case bytes(z):\n y = 0\n# case black_test_patma_073\nmatch x:\n case 0 if 0:\n y = 0\n case 0 if 1:\n y = 1\n# case black_test_patma_006\nmatch 3:\n case 0 | 1 | 2 | 3:\n x = True\n# case black_test_patma_049\nmatch x:\n case [0, 1] | [1, 0]:\n y = 0\n# case black_check_sequence_then_mapping\nmatch x:\n case [*_]:\n return \"seq\"\n case {}:\n return \"map\"\n# case black_test_patma_035\nmatch x:\n case {0: [1, 2, {}]}:\n y = 0\n case {0: [1, 2, {}] | True} | {1: [[]]} | {0: [1, 2, {}]} | [] | \"X\" | {}:\n y = 1\n case []:\n y = 2\n# case black_test_patma_107\nmatch x:\n case 0.25 + 1.75j:\n y = 0\n# case black_test_patma_097\nmatch x:\n case -0j:\n y = 0\n# case black_test_patma_007\nmatch 4:\n case 0 | 1 | 2 | 3:\n x = True\n# case black_test_patma_154\nmatch x:\n case 0 if x:\n y = 0\n# case black_test_patma_134\nmatch x:\n case {1: 0}:\n y = 0\n case {0: 0}:\n y = 1\n case {**z}:\n y = 2\n# case black_test_patma_185\nmatch Seq():\n case [*_]:\n y = 0\n# case black_test_patma_063\nmatch x:\n case 1:\n y = 0\n case 1:\n y = 1\n# case black_test_patma_248\nmatch x:\n case {\"foo\": bar}:\n y = bar\n# case black_test_patma_019\nmatch (0, 1, 2):\n case [0, 1, *x, 2]:\n y = 0\n# case black_test_patma_052\nmatch x:\n case [0]:\n y = 0\n case [1, 0] if x := x[:0]:\n y = 1\n case [1, 0]:\n y = 2\n# case black_test_patma_191\nmatch w:\n case [x, y, *_]:\n z = 0\n# case black_test_patma_110\nmatch x:\n case -0.25 - 1.75j:\n y = 0\n# case black_test_patma_151\nmatch (x,):\n case [y]:\n z = 0\n# case black_test_patma_114\nmatch x:\n case A.B.C.D:\n y = 0\n# case black_test_patma_232\nmatch x:\n case None:\n y = 0\n# case black_test_patma_058\nmatch x:\n case 0:\n y = 0\n# case black_test_patma_233\nmatch x:\n case False:\n y = 0\n# case black_test_patma_078\nmatch x:\n case []:\n y = 0\n case [\"\"]:\n y = 1\n case \"\":\n y = 2\n# case black_test_patma_156\nmatch x:\n case z:\n y = 0\n# case black_test_patma_189\nmatch w:\n case [x, y, *rest]:\n z = 0\n# case black_test_patma_042\nmatch x:\n case (0 as z) | (1 as z) | (2 as z) if z == x % 2:\n y = 0\n# case black_test_patma_034\nmatch x:\n case {0: [1, 2, {}]}:\n y = 0\n case {0: [1, 2, {}] | False} | {1: [[]]} | {0: [1, 2, {}]} | [] | \"X\" | {}:\n y = 1\n case []:\n y = 2\n# issue 3790\nmatch (X.type, Y):\n case _:\n pass\n# issue 3487\nmatch = re.match(r\"(?P<grade>LD|MD|HD)(?P<material>AL|SS)\", \"HDSS\")\n\nmatch (match.group(\"grade\"), match.group(\"material\")):\n case (\"MD\" | \"HD\", \"SS\" as code):\n print(\"You will get here\")\n" Received: "# Cases sampled from Lib/test/test_patma.py\n\n# case black_test_patma_098\nmatch x:\n case -0j:\n y = 0\n# case black_test_patma_142\nmatch x:\n case bytes(z):\n y = 0\n# case black_test_patma_073\nmatch x:\n case 0 if 0:\n y = 0\n case 0 if 1:\n y = 1\n# case black_test_patma_006\nmatch 3:\n case 0 | 1 | 2 | 3:\n x = True\n# case black_test_patma_049\nmatch x:\n case [0, 1] | [1, 0]:\n y = 0\n# case black_check_sequence_then_mapping\nmatch x:\n case [*_]:\n return \"seq\"\n case {}:\n return \"map\"\n# case black_test_patma_035\nmatch x:\n case {0: [1, 2, {}]}:\n y = 0\n case {0: [1, 2, {}] | True} | {1: [[]]} | {0: [1, 2, {}]} | [] | \"X\" | {}:\n y = 1\n case []:\n y = 2\n# case black_test_patma_107\nmatch x:\n case 0.25 + 1.75j:\n y = 0\n# case black_test_patma_097\nmatch x:\n case -0j:\n y = 0\n# case black_
error: expect(received).toBe(expected): crates/ruff_fmt/test_bun/bun.spec.ts#L23
Expected: "x = \"This is a really long string that can't possibly be expected to fit all together on one line. In fact it may even take up three or more lines... like four or five... but probably just three.\"\n\nx += \"This is a really long string that can't possibly be expected to fit all together on one line. In fact it may even take up three or more lines... like four or five... but probably just three.\"\n\ny = \"Short string\"\n\nprint(\n \"This is a really long string inside of a print statement with extra arguments attached at the end of it.\",\n x,\n y,\n z,\n)\n\nprint(\n \"This is a really long string inside of a print statement with no extra arguments attached at the end of it.\"\n)\n\nD1 = {\n \"The First\": \"This is a really long string that can't possibly be expected to fit all together on one line. Also it is inside a dictionary, so formatting is more difficult.\",\n \"The Second\": \"This is another really really (not really) long string that also can't be expected to fit on one line and is, like the other string, inside a dictionary.\",\n}\n\nD2 = {\n 1.0: \"This is a really long string that can't possibly be expected to fit all together on one line. Also it is inside a dictionary, so formatting is more difficult.\",\n 2.0: \"This is another really really (not really) long string that also can't be expected to fit on one line and is, like the other string, inside a dictionary.\",\n}\n\nD3 = {\n x: \"This is a really long string that can't possibly be expected to fit all together on one line. Also it is inside a dictionary, so formatting is more difficult.\",\n y: \"This is another really really (not really) long string that also can't be expected to fit on one line and is, like the other string, inside a dictionary.\",\n}\n\nD4 = {\n \"A long and ridiculous {}\".format(\n string_key\n ): \"This is a really really really long string that has to go i,side of a dictionary. It is soooo bad.\",\n some_func(\n \"calling\", \"some\", \"stuff\"\n ): \"This is a really really really long string that has to go inside of a dictionary. It is {soooo} bad (#{x}).\".format(\n sooo=\"soooo\", x=2\n ),\n \"A %s %s\"\n % (\n \"formatted\",\n \"string\",\n ): \"This is a really really really long string that has to go inside of a dictionary. It is %s bad (#%d).\"\n % (\"soooo\", 2),\n}\n\nfunc_with_keywords(\n my_arg,\n my_kwarg=\"Long keyword strings also need to be wrapped, but they will probably need to be handled a little bit differently.\",\n)\n\nbad_split1 = (\n \"But what should happen when code has already been formatted but in the wrong way? Like\"\n \" with a space at the end instead of the beginning. Or what about when it is split too soon?\"\n)\n\nbad_split2 = (\n \"But what should happen when code has already \"\n \"been formatted but in the wrong way? Like \"\n \"with a space at the end instead of the \"\n \"beginning. Or what about when it is split too \"\n \"soon? In the case of a split that is too \"\n \"short, black will try to honer the custom \"\n \"split.\"\n)\n\nbad_split3 = (\n \"What if we have inline comments on \" # First Comment\n \"each line of a bad split? In that \" # Second Comment\n \"case, we should just leave it alone.\" # Third Comment\n)\n\nbad_split_func1(\n \"But what should happen when code has already \"\n \"been formatted but in the wrong way? Like \"\n \"with a space at the end instead of the \"\n \"beginning. Or what about when it is split too \"\n \"soon? In the case of a split that is too \"\n \"short, black will try to honer the custom \"\n \"split.\",\n xxx,\n yyy,\n zzz,\n)\n\nbad_split_func2(\n xxx,\n yyy,\n zzz,\n long_string_kwarg=\"But what should happen when code has already been formatted but in the wrong way? Like \"\n \"with a space at the end instead of the beginning. Or what about when it is split too \"\n \"soon?\",\n)\n\nbad_split_func3(\n (\n \"But what should happen
deno-test
Process completed with exit code 1.
node-test
Process completed with exit code 1.

Artifacts

Produced during runtime
Name Size
build
1.29 MB