18.4a4 hotfix: don't populate the cache on --check

Fixes #175
This commit is contained in:
Łukasz Langa 2018-04-27 14:02:10 -07:00
parent 25abcea6c5
commit 0f3ecb7e50
2 changed files with 8 additions and 3 deletions

View File

@ -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 ### 18.4a3
* added a "cache"; files already reformatted that haven't changed on disk * added a "cache"; files already reformatted that haven't changed on disk

View File

@ -43,7 +43,7 @@
from blib2to3.pgen2 import driver, token from blib2to3.pgen2 import driver, token
from blib2to3.pgen2.parse import ParseError from blib2to3.pgen2.parse import ParseError
__version__ = "18.4a3" __version__ = "18.4a4"
DEFAULT_LINE_LENGTH = 88 DEFAULT_LINE_LENGTH = 88
# types # 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) write_cache(cache, [src], line_length)
report.done(src, changed) report.done(src, changed)
except Exception as exc: except Exception as exc:
@ -312,7 +312,7 @@ async def schedule_formatting(
if cancelled: if cancelled:
await asyncio.gather(*cancelled, loop=loop, return_exceptions=True) 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)