]> 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 unstable subscript assignment string wrapping (#1678)
authorBryan Bugyi <bryanbugyi34@gmail.com>
Thu, 10 Sep 2020 16:24:01 +0000 (12:24 -0400)
committerGitHub <noreply@github.com>
Thu, 10 Sep 2020 16:24:01 +0000 (09:24 -0700)
Fixes #1598

src/black/__init__.py
tests/data/long_strings__regression.py

index 3753d5fca8d71ea206b4bed2b21e994cd7a16b87..bfb77126218c303426dccf1bf8c2200cb97bbd3b 100644 (file)
@@ -3507,9 +3507,12 @@ class BaseStringSplitter(StringTransformer):
                 # WMA4 a single space.
                 offset += 1
 
                 # WMA4 a single space.
                 offset += 1
 
-                # WMA4 the lengths of any leaves that came before that space.
-                for leaf in LL[: p_idx + 1]:
+                # WMA4 the lengths of any leaves that came before that space,
+                # but after any closing bracket before that space.
+                for leaf in reversed(LL[: p_idx + 1]):
                     offset += len(str(leaf))
                     offset += len(str(leaf))
+                    if leaf.type in CLOSING_BRACKETS:
+                        break
 
         if is_valid_index(string_idx + 1):
             N = LL[string_idx + 1]
 
         if is_valid_index(string_idx + 1):
             N = LL[string_idx + 1]
index 1c82613d410b6a3a018976dc516cae0d51254f3c..8290a4cbc1c1c161bfd27494ae0c8edfd91fc07a 100644 (file)
@@ -349,6 +349,10 @@ class xxxxxxxxxxxxxxxxxxxxx(xxxx.xxxxxxxxxxxxx):
             x.xxxxx.xxxxxx.xxxxx.xxxx,
         ], ("xxxxxxxxxxx xxxxxxx xxxx (xxxxxx xxxx) %x xxx xxxxx" % xxxxxxx_xxxx)
 
             x.xxxxx.xxxxxx.xxxxx.xxxx,
         ], ("xxxxxxxxxxx xxxxxxx xxxx (xxxxxx xxxx) %x xxx xxxxx" % xxxxxxx_xxxx)
 
+value.__dict__[
+    key
+] = "test"  # set some Thrift field to non-None in the struct aa bb cc dd ee
+
 # output
 
 
 # output
 
 
@@ -784,3 +788,8 @@ class xxxxxxxxxxxxxxxxxxxxx(xxxx.xxxxxxxxxxxxx):
         ], (
             "xxxxxxxxxxx xxxxxxx xxxx (xxxxxx xxxx) %x xxx xxxxx" % xxxxxxx_xxxx
         )
         ], (
             "xxxxxxxxxxx xxxxxxx xxxx (xxxxxx xxxx) %x xxx xxxxx" % xxxxxxx_xxxx
         )
+
+
+value.__dict__[
+    key
+] = "test"  # set some Thrift field to non-None in the struct aa bb cc dd ee