]> 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:

18.4a4 hotfix: don't populate the cache on --check
authorŁukasz Langa <lukasz@langa.pl>
Fri, 27 Apr 2018 21:02:10 +0000 (14:02 -0700)
committerŁukasz Langa <lukasz@langa.pl>
Fri, 27 Apr 2018 21:04:46 +0000 (14:04 -0700)
Fixes #175

README.md
black.py

index 6cb50ebdb12ced6c9d9fee669cdc948d5b3cb7dc..bc8977b7a9acff4b8a2a1de39b7abb49f3183fb2 100644 (file)
--- a/README.md
+++ b/README.md
@@ -522,6 +522,11 @@ More details can be found in [CONTRIBUTING](CONTRIBUTING.md).
 
 ## Change Log
 
 
 ## Change Log
 
+### 18.4a4
+
+* don't populate the cache on `--check` (#175)
+
+
 ### 18.4a3
 
 * added a "cache"; files already reformatted that haven't changed on disk
 ### 18.4a3
 
 * added a "cache"; files already reformatted that haven't changed on disk
index 5458198b17560621545fdcb0d15a4c32fcdb6522..4c5f0f0c2590d476e53fdb3f5d19ed3152928a06 100644 (file)
--- a/black.py
+++ b/black.py
@@ -43,7 +43,7 @@ from blib2to3 import pygram, pytree
 from blib2to3.pgen2 import driver, token
 from blib2to3.pgen2.parse import ParseError
 
 from blib2to3.pgen2 import driver, token
 from blib2to3.pgen2.parse import ParseError
 
-__version__ = "18.4a3"
+__version__ = "18.4a4"
 DEFAULT_LINE_LENGTH = 88
 
 # types
 DEFAULT_LINE_LENGTH = 88
 
 # types
@@ -245,7 +245,7 @@ def reformat_one(
                 )
             ):
                 changed = Changed.YES
                 )
             ):
                 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:
                 write_cache(cache, [src], line_length)
         report.done(src, changed)
     except Exception as exc:
@@ -312,7 +312,7 @@ async def schedule_formatting(
 
     if cancelled:
         await asyncio.gather(*cancelled, loop=loop, return_exceptions=True)
 
     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)
 
 
         write_cache(cache, formatted, line_length)