From 0f3ecb7e500f9668a7f9ec74a43d8d565df6e2ea Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Langa?= Date: Fri, 27 Apr 2018 14:02:10 -0700 Subject: [PATCH] 18.4a4 hotfix: don't populate the cache on --check Fixes #175 --- README.md | 5 +++++ black.py | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6cb50eb..bc8977b 100644 --- a/README.md +++ b/README.md @@ -522,6 +522,11 @@ More details can be found in [CONTRIBUTING](CONTRIBUTING.md). ## 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 diff --git a/black.py b/black.py index 5458198..4c5f0f0 100644 --- 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 -__version__ = "18.4a3" +__version__ = "18.4a4" DEFAULT_LINE_LENGTH = 88 # types @@ -245,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: @@ -312,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) -- 2.39.5