]> git.madduck.net Git - etc/vim.git/blobdiff - black.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:

18.4a4 hotfix: don't populate the cache on --check
[etc/vim.git] / black.py
index 21e37435105164883391ecabe83e1f3510e24434..4c5f0f0c2590d476e53fdb3f5d19ed3152928a06 100644 (file)
--- a/black.py
+++ b/black.py
@@ -43,8 +43,9 @@ from blib2to3 import pygram, pytree
 from blib2to3.pgen2 import driver, token
 from blib2to3.pgen2.parse import ParseError
 
-__version__ = "18.4a2"
+__version__ = "18.4a4"
 DEFAULT_LINE_LENGTH = 88
+
 # types
 syms = pygram.python_symbols
 FileContent = str
@@ -244,7 +245,7 @@ def reformat_one(
                 )
             ):
                 changed = Changed.YES
-            if write_back != WriteBack.DIFF and changed is not Changed.NO:
+            if write_back == WriteBack.YES and changed is not Changed.NO:
                 write_cache(cache, [src], line_length)
         report.done(src, changed)
     except Exception as exc:
@@ -311,7 +312,7 @@ async def schedule_formatting(
 
     if cancelled:
         await asyncio.gather(*cancelled, loop=loop, return_exceptions=True)
-    if write_back != WriteBack.DIFF and formatted:
+    if write_back == WriteBack.YES and formatted:
         write_cache(cache, formatted, line_length)
 
 
@@ -1983,13 +1984,14 @@ def standalone_comment_split(line: Line, py36: bool = False) -> Iterator[Line]:
 def explode_split(
     line: Line, py36: bool = False, omit: Collection[LeafID] = ()
 ) -> Iterator[Line]:
-    """Split by RHS and immediately split contents by a delimiter."""
+    """Split by rightmost bracket and immediately split contents by a delimiter."""
     new_lines = list(right_hand_split(line, py36, omit))
     if len(new_lines) != 3:
         yield from new_lines
         return
 
     yield new_lines[0]
+
     try:
         yield from delimiter_split(new_lines[1], py36)
     except CannotSplit: