]> 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 improper unmodified file caching when `-S` was used
authorŁukasz Langa <lukasz@langa.pl>
Wed, 6 Jun 2018 18:58:36 +0000 (11:58 -0700)
committerŁukasz Langa <lukasz@langa.pl>
Wed, 6 Jun 2018 22:46:30 +0000 (15:46 -0700)
This will also future-proof the cache to changes to FileMode.

README.md
black.py

index bdc000a6f6e6ea43136822a4992d812e0d65b2af..00179a93198d4d1dfebff5bd5fac8f3c5c2a52a0 100644 (file)
--- a/README.md
+++ b/README.md
@@ -712,6 +712,11 @@ More details can be found in [CONTRIBUTING](CONTRIBUTING.md).
 
 ## Change Log
 
+### 18.6b2
+
+* fixed improper unmodified file caching when `-S` was used
+
+
 ### 18.6b1
 
 * hotfix: don't output human-facing information on stdout (#299)
index e72db2b1e0650b95a68c3659fd351e461b677578..80401f5e5c5e4d2d6cc297351b7564350615b0ed 100644 (file)
--- a/black.py
+++ b/black.py
@@ -3335,12 +3335,7 @@ def can_omit_invisible_parens(line: Line, line_length: int) -> bool:
 
 
 def get_cache_file(line_length: int, mode: FileMode) -> Path:
-    pyi = bool(mode & FileMode.PYI)
-    py36 = bool(mode & FileMode.PYTHON36)
-    return (
-        CACHE_DIR
-        / f"cache.{line_length}{'.pyi' if pyi else ''}{'.py36' if py36 else ''}.pickle"
-    )
+    return CACHE_DIR / f"cache.{line_length}.{mode.value}.pickle"
 
 
 def read_cache(line_length: int, mode: FileMode) -> Cache: