]> git.madduck.net Git - etc/vim.git/blob - tests/data/preview/long_strings.py

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Add parens around implicit string concatenations where it increases readability ...
[etc/vim.git] / tests / data / preview / long_strings.py
1 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."
2
3 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."
4
5 y = (
6     'Short string'
7 )
8
9 print('This is a really long string inside of a print statement with extra arguments attached at the end of it.', x, y, z)
10
11 print("This is a really long string inside of a print statement with no extra arguments attached at the end of it.")
12
13 D1 = {"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.", "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."}
14
15 D2 = {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.", 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."}
16
17 D3 = {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.", 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."}
18
19 D4 = {"A long and ridiculous {}".format(string_key): "This is a really really really long string that has to go i,side of a dictionary. It is soooo bad.", some_func("calling", "some", "stuff"): "This is a really really really long string that has to go inside of a dictionary. It is {soooo} bad (#{x}).".format(sooo="soooo", x=2), "A %s %s" % ("formatted", "string"): "This is a really really really long string that has to go inside of a dictionary. It is %s bad (#%d)." % ("soooo", 2)}
20
21 L1 = ["The is a short string", "This is a really long string that can't possibly be expected to fit all together on one line. Also it is inside a list literal, so it's expected to be wrapped in parens when spliting to avoid implicit str concatenation.", short_call("arg", {"key": "value"}), "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 list literal.", ("parens should be stripped for short string in list")]
22
23 L2 = ["This is a really long string that can't be expected to fit in one line and is the only child of a list literal."]
24
25 S1 = {"The is a short string", "This is a really long string that can't possibly be expected to fit all together on one line. Also it is inside a set literal, so it's expected to be wrapped in parens when spliting to avoid implicit str concatenation.", short_call("arg", {"key": "value"}), "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 set literal.", ("parens should be stripped for short string in set")}
26
27 S2 = {"This is a really long string that can't be expected to fit in one line and is the only child of a set literal."}
28
29 T1 = ("The is a short string", "This is a really long string that can't possibly be expected to fit all together on one line. Also it is inside a tuple literal, so it's expected to be wrapped in parens when spliting to avoid implicit str concatenation.", short_call("arg", {"key": "value"}), "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 tuple literal.", ("parens should be stripped for short string in list"))
30
31 T2 = ("This is a really long string that can't be expected to fit in one line and is the only child of a tuple literal.",)
32
33 func_with_keywords(my_arg, my_kwarg="Long keyword strings also need to be wrapped, but they will probably need to be handled a little bit differently.")
34
35 bad_split1 = (
36     'But what should happen when code has already been formatted but in the wrong way? Like'
37     " with a space at the end instead of the beginning. Or what about when it is split too soon?"
38 )
39
40 bad_split2 = "But what should happen when code has already " \
41              "been formatted but in the wrong way? Like " \
42              "with a space at the end instead of the " \
43              "beginning. Or what about when it is split too " \
44              "soon? In the case of a split that is too " \
45              "short, black will try to honer the custom " \
46              "split."
47
48 bad_split3 = (
49     "What if we have inline comments on "  # First Comment
50     "each line of a bad split? In that "  # Second Comment
51     "case, we should just leave it alone."  # Third Comment
52 )
53
54 bad_split_func1(
55     "But what should happen when code has already "
56     "been formatted but in the wrong way? Like "
57     "with a space at the end instead of the "
58     "beginning. Or what about when it is split too "
59     "soon? In the case of a split that is too "
60     "short, black will try to honer the custom "
61     "split.",
62     xxx, yyy, zzz
63 )
64
65 bad_split_func2(
66     xxx, yyy, zzz,
67     long_string_kwarg="But what should happen when code has already been formatted but in the wrong way? Like "
68                       "with a space at the end instead of the beginning. Or what about when it is split too "
69                       "soon?",
70 )
71
72 bad_split_func3(
73     (
74         "But what should happen when code has already "
75         r"been formatted but in the wrong way? Like "
76         "with a space at the end instead of the "
77         r"beginning. Or what about when it is split too "
78         r"soon? In the case of a split that is too "
79         "short, black will try to honer the custom "
80         "split."
81     ),
82     xxx,
83     yyy,
84     zzz,
85 )
86
87 inline_comments_func1(
88     "if there are inline "
89     "comments in the middle "
90     # Here is the standard alone comment.
91     "of the implicitly concatenated "
92     "string, we should handle "
93     "them correctly",
94     xxx,
95 )
96
97 inline_comments_func2(
98     "what if the string is very very very very very very very very very very long and this part does "
99     "not fit into a single line? "
100     # Here is the standard alone comment.
101     "then the string should still be properly handled by merging and splitting "
102     "it into parts that fit in line length.",
103     xxx,
104 )
105
106 raw_string = r"This is a long raw string. When re-formatting this string, black needs to make sure it prepends the 'r' onto the new string."
107
108 fmt_string1 = "We also need to be sure to preserve any and all {} which may or may not be attached to the string in question.".format("method calls")
109
110 fmt_string2 = "But what about when the string is {} but {}".format("short", "the method call is really really really really really really really really long?")
111
112 old_fmt_string1 = "While we are on the topic of %s, we should also note that old-style formatting must also be preserved, since some %s still uses it." % ("formatting", "code")
113
114 old_fmt_string2 = "This is a %s %s %s %s" % ("really really really really really", "old", "way to format strings!", "Use f-strings instead!")
115
116 old_fmt_string3 = "Whereas only the strings after the percent sign were long in the last example, this example uses a long initial string as well. This is another %s %s %s %s" % ("really really really really really", "old", "way to format strings!", "Use f-strings instead!")
117
118 fstring = f"f-strings definitely make things more {difficult} than they need to be for {{black}}. But boy they sure are handy. The problem is that some lines will need to have the 'f' whereas others do not. This {line}, for example, needs one."
119
120 fstring_with_no_fexprs = f"Some regular string that needs to get split certainly but is NOT an fstring by any means whatsoever."
121
122 comment_string = "Long lines with inline comments should have their comments appended to the reformatted string's enclosing right parentheses."  # This comment gets thrown to the top.
123
124 arg_comment_string = print("Long lines with inline comments which are apart of (and not the only member of) an argument list should have their comments appended to the reformatted string's enclosing left parentheses.",  # This comment gets thrown to the top.
125     "Arg #2", "Arg #3", "Arg #4", "Arg #5")
126
127 pragma_comment_string1 = "Lines which end with an inline pragma comment of the form `# <pragma>: <...>` should be left alone."  # noqa: E501
128
129 pragma_comment_string2 = "Lines which end with an inline pragma comment of the form `# <pragma>: <...>` should be left alone."  # noqa
130
131 """This is a really really really long triple quote string and it should not be touched."""
132
133 triple_quote_string = """This is a really really really long triple quote string assignment and it should not be touched."""
134
135 assert some_type_of_boolean_expression, "Followed by a really really really long string that is used to provide context to the AssertionError exception."
136
137 assert some_type_of_boolean_expression, "Followed by a really really really long string that is used to provide context to the AssertionError exception, which uses dynamic string {}.".format("formatting")
138
139 assert some_type_of_boolean_expression, "Followed by a really really really long string that is used to provide context to the AssertionError exception, which uses dynamic string %s." % "formatting"
140
141 assert some_type_of_boolean_expression, "Followed by a really really really long string that is used to provide context to the AssertionError exception, which uses dynamic %s %s." % ("string", "formatting")
142
143 some_function_call("With a reallly generic name and with a really really long string that is, at some point down the line, " + added + " to a variable and then added to another string.")
144
145 some_function_call("With a reallly generic name and with a really really long string that is, at some point down the line, " + added + " to a variable and then added to another string. But then what happens when the final string is also supppppperrrrr long?! Well then that second (realllllllly long) string should be split too.", "and a second argument", and_a_third)
146
147 return "A really really really really really really really really really really really really really long {} {}".format("return", "value")
148
149 func_with_bad_comma(
150     "This is a really long string argument to a function that has a trailing comma which should NOT be there.",
151 )
152
153 func_with_bad_comma(
154     "This is a really long string argument to a function that has a trailing comma which should NOT be there.", # comment after comma
155 )
156
157 func_with_bad_comma(
158     (
159         "This is a really long string argument to a function that has a trailing comma"
160         " which should NOT be there."
161     ),
162 )
163
164 func_with_bad_comma(
165     (
166         "This is a really long string argument to a function that has a trailing comma"
167         " which should NOT be there."
168     ), # comment after comma
169 )
170
171 func_with_bad_parens_that_wont_fit_in_one_line(
172     ("short string that should have parens stripped"),
173     x,
174     y,
175     z
176 )
177
178 func_with_bad_parens_that_wont_fit_in_one_line(
179     x,
180     y,
181     ("short string that should have parens stripped"),
182     z
183 )
184
185 func_with_bad_parens(
186     ("short string that should have parens stripped"),
187     x,
188     y,
189     z,
190 )
191
192 func_with_bad_parens(
193     x,
194     y,
195     ("short string that should have parens stripped"),
196     z,
197 )
198
199 annotated_variable: Final = "This is a large " + STRING + " that has been " + CONCATENATED + "using the '+' operator."
200 annotated_variable: Final = "This is a large string that has a type annotation attached to it. A type annotation should NOT stop a long string from being wrapped."
201 annotated_variable: Literal["fakse_literal"] = "This is a large string that has a type annotation attached to it. A type annotation should NOT stop a long string from being wrapped."
202
203 backslashes = "This is a really long string with \"embedded\" double quotes and 'single' quotes that also handles checking for an even number of backslashes \\"
204 backslashes = "This is a really long string with \"embedded\" double quotes and 'single' quotes that also handles checking for an even number of backslashes \\\\"
205 backslashes = "This is a really 'long' string with \"embedded double quotes\" and 'single' quotes that also handles checking for an odd number of backslashes \\\", like this...\\\\\\"
206
207 short_string = (
208     "Hi"
209     " there."
210 )
211
212 func_call(
213     short_string=(
214         "Hi"
215         " there."
216     )
217 )
218
219 raw_strings = r"Don't" " get" r" merged" " unless they are all raw."
220
221 def foo():
222     yield "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."
223
224 x = f"This is a {{really}} long string that needs to be split without a doubt (i.e. most definitely). In short, this {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 four."
225
226 long_unmergable_string_with_pragma = (
227     "This is a really long string that can't be merged because it has a likely pragma at the end"  # type: ignore
228     " of it."
229 )
230
231 long_unmergable_string_with_pragma = (
232     "This is a really long string that can't be merged because it has a likely pragma at the end"  # noqa
233     " of it."
234 )
235
236 long_unmergable_string_with_pragma = (
237     "This is a really long string that can't be merged because it has a likely pragma at the end"  # pylint: disable=some-pylint-check
238     " of it."
239 )
240
241 string_with_nameescape = (
242     "........................................................................ \N{LAO KO LA}"
243 )
244
245 string_with_nameescape = (
246     "........................................................................... \N{LAO KO LA}"
247 )
248
249 string_with_nameescape = (
250     "............................................................................ \N{LAO KO LA}"
251 )
252
253 string_with_nameescape_and_escaped_backslash = (
254     "...................................................................... \\\N{LAO KO LA}"
255 )
256
257 string_with_nameescape_and_escaped_backslash = (
258     "......................................................................... \\\N{LAO KO LA}"
259 )
260
261 string_with_nameescape_and_escaped_backslash = (
262     ".......................................................................... \\\N{LAO KO LA}"
263 )
264
265 string_with_escaped_nameescape = (
266     "........................................................................ \\N{LAO KO LA}"
267 )
268
269 string_with_escaped_nameescape = (
270     "........................................................................... \\N{LAO KO LA}"
271 )
272
273
274 # output
275
276
277 x = (
278     "This is a really long string that can't possibly be expected to fit all together"
279     " on one line. In fact it may even take up three or more lines... like four or"
280     " five... but probably just three."
281 )
282
283 x += (
284     "This is a really long string that can't possibly be expected to fit all together"
285     " on one line. In fact it may even take up three or more lines... like four or"
286     " five... but probably just three."
287 )
288
289 y = "Short string"
290
291 print(
292     "This is a really long string inside of a print statement with extra arguments"
293     " attached at the end of it.",
294     x,
295     y,
296     z,
297 )
298
299 print(
300     "This is a really long string inside of a print statement with no extra arguments"
301     " attached at the end of it."
302 )
303
304 D1 = {
305     "The First": (
306         "This is a really long string that can't possibly be expected to fit all"
307         " together on one line. Also it is inside a dictionary, so formatting is more"
308         " difficult."
309     ),
310     "The Second": (
311         "This is another really really (not really) long string that also can't be"
312         " expected to fit on one line and is, like the other string, inside a"
313         " dictionary."
314     ),
315 }
316
317 D2 = {
318     1.0: (
319         "This is a really long string that can't possibly be expected to fit all"
320         " together on one line. Also it is inside a dictionary, so formatting is more"
321         " difficult."
322     ),
323     2.0: (
324         "This is another really really (not really) long string that also can't be"
325         " expected to fit on one line and is, like the other string, inside a"
326         " dictionary."
327     ),
328 }
329
330 D3 = {
331     x: (
332         "This is a really long string that can't possibly be expected to fit all"
333         " together on one line. Also it is inside a dictionary, so formatting is more"
334         " difficult."
335     ),
336     y: (
337         "This is another really really (not really) long string that also can't be"
338         " expected to fit on one line and is, like the other string, inside a"
339         " dictionary."
340     ),
341 }
342
343 D4 = {
344     "A long and ridiculous {}".format(string_key): (
345         "This is a really really really long string that has to go i,side of a"
346         " dictionary. It is soooo bad."
347     ),
348     some_func("calling", "some", "stuff"): (
349         "This is a really really really long string that has to go inside of a"
350         " dictionary. It is {soooo} bad (#{x}).".format(sooo="soooo", x=2)
351     ),
352     "A %s %s"
353     % ("formatted", "string"): (
354         "This is a really really really long string that has to go inside of a"
355         " dictionary. It is %s bad (#%d)."
356     )
357     % ("soooo", 2),
358 }
359
360 L1 = [
361     "The is a short string",
362     (
363         "This is a really long string that can't possibly be expected to fit all"
364         " together on one line. Also it is inside a list literal, so it's expected to"
365         " be wrapped in parens when spliting to avoid implicit str concatenation."
366     ),
367     short_call("arg", {"key": "value"}),
368     (
369         "This is another really really (not really) long string that also can't be"
370         " expected to fit on one line and is, like the other string, inside a list"
371         " literal."
372     ),
373     "parens should be stripped for short string in list",
374 ]
375
376 L2 = [
377     "This is a really long string that can't be expected to fit in one line and is the"
378     " only child of a list literal."
379 ]
380
381 S1 = {
382     "The is a short string",
383     (
384         "This is a really long string that can't possibly be expected to fit all"
385         " together on one line. Also it is inside a set literal, so it's expected to be"
386         " wrapped in parens when spliting to avoid implicit str concatenation."
387     ),
388     short_call("arg", {"key": "value"}),
389     (
390         "This is another really really (not really) long string that also can't be"
391         " expected to fit on one line and is, like the other string, inside a set"
392         " literal."
393     ),
394     "parens should be stripped for short string in set",
395 }
396
397 S2 = {
398     "This is a really long string that can't be expected to fit in one line and is the"
399     " only child of a set literal."
400 }
401
402 T1 = (
403     "The is a short string",
404     (
405         "This is a really long string that can't possibly be expected to fit all"
406         " together on one line. Also it is inside a tuple literal, so it's expected to"
407         " be wrapped in parens when spliting to avoid implicit str concatenation."
408     ),
409     short_call("arg", {"key": "value"}),
410     (
411         "This is another really really (not really) long string that also can't be"
412         " expected to fit on one line and is, like the other string, inside a tuple"
413         " literal."
414     ),
415     "parens should be stripped for short string in list",
416 )
417
418 T2 = (
419     (
420         "This is a really long string that can't be expected to fit in one line and is"
421         " the only child of a tuple literal."
422     ),
423 )
424
425 func_with_keywords(
426     my_arg,
427     my_kwarg=(
428         "Long keyword strings also need to be wrapped, but they will probably need to"
429         " be handled a little bit differently."
430     ),
431 )
432
433 bad_split1 = (
434     "But what should happen when code has already been formatted but in the wrong way?"
435     " Like with a space at the end instead of the beginning. Or what about when it is"
436     " split too soon?"
437 )
438
439 bad_split2 = (
440     "But what should happen when code has already "
441     "been formatted but in the wrong way? Like "
442     "with a space at the end instead of the "
443     "beginning. Or what about when it is split too "
444     "soon? In the case of a split that is too "
445     "short, black will try to honer the custom "
446     "split."
447 )
448
449 bad_split3 = (
450     "What if we have inline comments on "  # First Comment
451     "each line of a bad split? In that "  # Second Comment
452     "case, we should just leave it alone."  # Third Comment
453 )
454
455 bad_split_func1(
456     "But what should happen when code has already "
457     "been formatted but in the wrong way? Like "
458     "with a space at the end instead of the "
459     "beginning. Or what about when it is split too "
460     "soon? In the case of a split that is too "
461     "short, black will try to honer the custom "
462     "split.",
463     xxx,
464     yyy,
465     zzz,
466 )
467
468 bad_split_func2(
469     xxx,
470     yyy,
471     zzz,
472     long_string_kwarg=(
473         "But what should happen when code has already been formatted but in the wrong"
474         " way? Like with a space at the end instead of the beginning. Or what about"
475         " when it is split too soon?"
476     ),
477 )
478
479 bad_split_func3(
480     (
481         "But what should happen when code has already "
482         r"been formatted but in the wrong way? Like "
483         "with a space at the end instead of the "
484         r"beginning. Or what about when it is split too "
485         r"soon? In the case of a split that is too "
486         "short, black will try to honer the custom "
487         "split."
488     ),
489     xxx,
490     yyy,
491     zzz,
492 )
493
494 inline_comments_func1(
495     "if there are inline comments in the middle "
496     # Here is the standard alone comment.
497     "of the implicitly concatenated string, we should handle them correctly",
498     xxx,
499 )
500
501 inline_comments_func2(
502     "what if the string is very very very very very very very very very very long and"
503     " this part does not fit into a single line? "
504     # Here is the standard alone comment.
505     "then the string should still be properly handled by merging and splitting "
506     "it into parts that fit in line length.",
507     xxx,
508 )
509
510 raw_string = (
511     r"This is a long raw string. When re-formatting this string, black needs to make"
512     r" sure it prepends the 'r' onto the new string."
513 )
514
515 fmt_string1 = (
516     "We also need to be sure to preserve any and all {} which may or may not be"
517     " attached to the string in question.".format("method calls")
518 )
519
520 fmt_string2 = "But what about when the string is {} but {}".format(
521     "short",
522     "the method call is really really really really really really really really long?",
523 )
524
525 old_fmt_string1 = (
526     "While we are on the topic of %s, we should also note that old-style formatting"
527     " must also be preserved, since some %s still uses it." % ("formatting", "code")
528 )
529
530 old_fmt_string2 = "This is a %s %s %s %s" % (
531     "really really really really really",
532     "old",
533     "way to format strings!",
534     "Use f-strings instead!",
535 )
536
537 old_fmt_string3 = (
538     "Whereas only the strings after the percent sign were long in the last example,"
539     " this example uses a long initial string as well. This is another %s %s %s %s"
540     % (
541         "really really really really really",
542         "old",
543         "way to format strings!",
544         "Use f-strings instead!",
545     )
546 )
547
548 fstring = (
549     f"f-strings definitely make things more {difficult} than they need to be for"
550     " {black}. But boy they sure are handy. The problem is that some lines will need"
551     f" to have the 'f' whereas others do not. This {line}, for example, needs one."
552 )
553
554 fstring_with_no_fexprs = (
555     f"Some regular string that needs to get split certainly but is NOT an fstring by"
556     f" any means whatsoever."
557 )
558
559 comment_string = (  # This comment gets thrown to the top.
560     "Long lines with inline comments should have their comments appended to the"
561     " reformatted string's enclosing right parentheses."
562 )
563
564 arg_comment_string = print(
565     "Long lines with inline comments which are apart of (and not the only member of) an"
566     " argument list should have their comments appended to the reformatted string's"
567     " enclosing left parentheses.",  # This comment gets thrown to the top.
568     "Arg #2",
569     "Arg #3",
570     "Arg #4",
571     "Arg #5",
572 )
573
574 pragma_comment_string1 = "Lines which end with an inline pragma comment of the form `# <pragma>: <...>` should be left alone."  # noqa: E501
575
576 pragma_comment_string2 = "Lines which end with an inline pragma comment of the form `# <pragma>: <...>` should be left alone."  # noqa
577
578 """This is a really really really long triple quote string and it should not be touched."""
579
580 triple_quote_string = """This is a really really really long triple quote string assignment and it should not be touched."""
581
582 assert some_type_of_boolean_expression, (
583     "Followed by a really really really long string that is used to provide context to"
584     " the AssertionError exception."
585 )
586
587 assert some_type_of_boolean_expression, (
588     "Followed by a really really really long string that is used to provide context to"
589     " the AssertionError exception, which uses dynamic string {}.".format("formatting")
590 )
591
592 assert some_type_of_boolean_expression, (
593     "Followed by a really really really long string that is used to provide context to"
594     " the AssertionError exception, which uses dynamic string %s." % "formatting"
595 )
596
597 assert some_type_of_boolean_expression, (
598     "Followed by a really really really long string that is used to provide context to"
599     " the AssertionError exception, which uses dynamic %s %s."
600     % ("string", "formatting")
601 )
602
603 some_function_call(
604     "With a reallly generic name and with a really really long string that is, at some"
605     " point down the line, "
606     + added
607     + " to a variable and then added to another string."
608 )
609
610 some_function_call(
611     "With a reallly generic name and with a really really long string that is, at some"
612     " point down the line, "
613     + added
614     + " to a variable and then added to another string. But then what happens when the"
615     " final string is also supppppperrrrr long?! Well then that second (realllllllly"
616     " long) string should be split too.",
617     "and a second argument",
618     and_a_third,
619 )
620
621 return (
622     "A really really really really really really really really really really really"
623     " really really long {} {}".format("return", "value")
624 )
625
626 func_with_bad_comma(
627     "This is a really long string argument to a function that has a trailing comma"
628     " which should NOT be there.",
629 )
630
631 func_with_bad_comma(
632     "This is a really long string argument to a function that has a trailing comma"
633     " which should NOT be there.",  # comment after comma
634 )
635
636 func_with_bad_comma(
637     "This is a really long string argument to a function that has a trailing comma"
638     " which should NOT be there.",
639 )
640
641 func_with_bad_comma(
642     "This is a really long string argument to a function that has a trailing comma"
643     " which should NOT be there.",  # comment after comma
644 )
645
646 func_with_bad_parens_that_wont_fit_in_one_line(
647     "short string that should have parens stripped", x, y, z
648 )
649
650 func_with_bad_parens_that_wont_fit_in_one_line(
651     x, y, "short string that should have parens stripped", z
652 )
653
654 func_with_bad_parens(
655     "short string that should have parens stripped",
656     x,
657     y,
658     z,
659 )
660
661 func_with_bad_parens(
662     x,
663     y,
664     "short string that should have parens stripped",
665     z,
666 )
667
668 annotated_variable: Final = (
669     "This is a large "
670     + STRING
671     + " that has been "
672     + CONCATENATED
673     + "using the '+' operator."
674 )
675 annotated_variable: Final = (
676     "This is a large string that has a type annotation attached to it. A type"
677     " annotation should NOT stop a long string from being wrapped."
678 )
679 annotated_variable: Literal["fakse_literal"] = (
680     "This is a large string that has a type annotation attached to it. A type"
681     " annotation should NOT stop a long string from being wrapped."
682 )
683
684 backslashes = (
685     "This is a really long string with \"embedded\" double quotes and 'single' quotes"
686     " that also handles checking for an even number of backslashes \\"
687 )
688 backslashes = (
689     "This is a really long string with \"embedded\" double quotes and 'single' quotes"
690     " that also handles checking for an even number of backslashes \\\\"
691 )
692 backslashes = (
693     "This is a really 'long' string with \"embedded double quotes\" and 'single' quotes"
694     ' that also handles checking for an odd number of backslashes \\", like'
695     " this...\\\\\\"
696 )
697
698 short_string = "Hi there."
699
700 func_call(short_string="Hi there.")
701
702 raw_strings = r"Don't" " get" r" merged" " unless they are all raw."
703
704
705 def foo():
706     yield (
707         "This is a really long string that can't possibly be expected to fit all"
708         " together on one line. In fact it may even take up three or more lines... like"
709         " four or five... but probably just three."
710     )
711
712
713 x = (
714     "This is a {really} long string that needs to be split without a doubt (i.e."
715     f" most definitely). In short, this {string} that can't possibly be {{expected}} to"
716     f" fit all together on one line. In {fact} it may even take up three or more"
717     " lines... like four or five... but probably just four."
718 )
719
720 long_unmergable_string_with_pragma = (
721     "This is a really long string that can't be merged because it has a likely pragma at the end"  # type: ignore
722     " of it."
723 )
724
725 long_unmergable_string_with_pragma = (
726     "This is a really long string that can't be merged because it has a likely pragma at the end"  # noqa
727     " of it."
728 )
729
730 long_unmergable_string_with_pragma = (
731     "This is a really long string that can't be merged because it has a likely pragma at the end"  # pylint: disable=some-pylint-check
732     " of it."
733 )
734
735 string_with_nameescape = (
736     "........................................................................"
737     " \N{LAO KO LA}"
738 )
739
740 string_with_nameescape = (
741     "..........................................................................."
742     " \N{LAO KO LA}"
743 )
744
745 string_with_nameescape = (
746     "............................................................................"
747     " \N{LAO KO LA}"
748 )
749
750 string_with_nameescape_and_escaped_backslash = (
751     "......................................................................"
752     " \\\N{LAO KO LA}"
753 )
754
755 string_with_nameescape_and_escaped_backslash = (
756     "........................................................................."
757     " \\\N{LAO KO LA}"
758 )
759
760 string_with_nameescape_and_escaped_backslash = (
761     ".........................................................................."
762     " \\\N{LAO KO LA}"
763 )
764
765 string_with_escaped_nameescape = (
766     "........................................................................ \\N{LAO"
767     " KO LA}"
768 )
769
770 string_with_escaped_nameescape = (
771     "..........................................................................."
772     " \\N{LAO KO LA}"
773 )