X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/6e97c5f47cbec72c72c27aefb206589dd84707a7..f6188ce6dcde3fcad381c52ecc74374e7d0579c9:/src/black/mode.py?ds=inline diff --git a/src/black/mode.py b/src/black/mode.py index b6d1a1f..6b74c14 100644 --- a/src/black/mode.py +++ b/src/black/mode.py @@ -4,6 +4,7 @@ Mostly around Python language feature support per version and Black configuratio chosen by the user. """ +from hashlib import sha256 import sys from dataclasses import dataclass, field @@ -126,7 +127,8 @@ class Preview(Enum): """Individual preview style features.""" string_processing = auto() - hug_simple_powers = auto() + remove_redundant_parens = auto() + one_element_subscript = auto() class Deprecated(UserWarning): @@ -142,6 +144,7 @@ class Mode: is_ipynb: bool = False magic_trailing_comma: bool = True experimental_string_processing: bool = False + python_cell_magics: Set[str] = field(default_factory=set) preview: bool = False def __post_init__(self) -> None: @@ -180,5 +183,6 @@ class Mode: str(int(self.magic_trailing_comma)), str(int(self.experimental_string_processing)), str(int(self.preview)), + sha256((",".join(sorted(self.python_cell_magics))).encode()).hexdigest(), ] return ".".join(parts)