Skip to content

Commit

Permalink
Merge cce474a into 67d5532
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleZijlstra committed Apr 25, 2021
2 parents 67d5532 + cce474a commit f8960a9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
## Change Log

### Unreleased

#### _Black_

- Reflect the `--skip-magic-trailing-comma` and `--experimental-string-processing` flags
in the name of the cache file. Without this fix, changes in these flags would not take
effect if the cache had already been populated. (#2131)

### 21.4b0

#### _Black_
Expand Down
4 changes: 3 additions & 1 deletion src/black/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,9 @@ class Mode:
target_versions: Set[TargetVersion] = field(default_factory=set)
line_length: int = DEFAULT_LINE_LENGTH
string_normalization: bool = True
is_pyi: bool = False
magic_trailing_comma: bool = True
experimental_string_processing: bool = False
is_pyi: bool = False

def get_cache_key(self) -> str:
if self.target_versions:
Expand All @@ -290,6 +290,8 @@ def get_cache_key(self) -> str:
str(self.line_length),
str(int(self.string_normalization)),
str(int(self.is_pyi)),
str(int(self.magic_trailing_comma)),
str(int(self.experimental_string_processing)),
]
return ".".join(parts)

Expand Down

0 comments on commit f8960a9

Please sign in to comment.