]> git.madduck.net Git - etc/vim.git/commitdiff

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:

Fix regular expression that black uses to identify f-expressions (#2287)
authorBryan Bugyi <bryanbugyi34@gmail.com>
Sun, 30 May 2021 22:34:33 +0000 (18:34 -0400)
committerGitHub <noreply@github.com>
Sun, 30 May 2021 22:34:33 +0000 (15:34 -0700)
Fixes #1469

CHANGES.md
src/black/trans.py
tests/data/long_strings__regression.py

index c761d14624acf1f8c68dae73d14408b4b71012c2..392569822150a5922ba5cf914409c5fb1e5610e5 100644 (file)
@@ -12,6 +12,7 @@
 - Add extra uvloop install + import support if in python env (#2258)
 - Fix --experimental-string-processing crash when matching parens are not found (#2283)
 - Make sure to split lines that start with a string operator (#2286)
+- Fix regular expression that black uses to identify f-expressions (#2287)
 
 ### _Blackd_
 
index 80e88a2d2fb78d834ed281256b8b3dd97511a16a..fd0de72762042bf96418178891d3f4a7928c86ab 100644 (file)
@@ -971,8 +971,8 @@ class StringSplitter(CustomSplitMapMixin, BaseStringSplitter):
             | \{\{
             | \}\}
             | (?R)
-        )+?
-    (?<!\}) \} (?:\}\})* (?!\})
+        )+
+    \}
     """
 
     def do_splitter_match(self, line: Line) -> TMatchResult:
index bd7b635132175710c390db23f611214155d108d4..cd8053f9eb5813627f5c2c26a3fdb2dde80f6297 100644 (file)
@@ -407,6 +407,12 @@ def _legacy_listen_examples():
     )
 
 
+temp_msg = (
+    f"{f'{humanize_number(pos)}.': <{pound_len+2}} "
+    f"{balance: <{bal_len + 5}} "
+    f"<<{author.display_name}>>\n"
+)
+
 assert str(suffix_arr) == (
     "['$', 'angaroo$', 'angrykangaroo$', 'aroo$', 'garoo$', "
     "'grykangaroo$', 'kangaroo$', 'ngaroo$', 'ngrykangaroo$', "
@@ -942,6 +948,12 @@ def _legacy_listen_examples():
     )
 
 
+temp_msg = (
+    f"{f'{humanize_number(pos)}.': <{pound_len+2}} "
+    f"{balance: <{bal_len + 5}} "
+    f"<<{author.display_name}>>\n"
+)
+
 assert (
     str(suffix_arr)
     == "['$', 'angaroo$', 'angrykangaroo$', 'aroo$', 'garoo$', "