X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/521d1b8129c2d83b4ab49270fe7473802259c2a2..6e97c5f47cbec72c72c27aefb206589dd84707a7:/src/black/__init__.py diff --git a/src/black/__init__.py b/src/black/__init__.py index cfa2c76..67c272e 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -241,9 +241,14 @@ def validate_regex( "--experimental-string-processing", is_flag=True, hidden=True, + help="(DEPRECATED and now included in --preview) Normalize string literals.", +) +@click.option( + "--preview", + is_flag=True, help=( - "Experimental option that performs more normalization on string literals." - " Currently disabled because it leads to some crashes." + "Enable potentially disruptive style changes that will be added to Black's main" + " functionality in the next major release." ), ) @click.option( @@ -399,6 +404,7 @@ def main( skip_string_normalization: bool, skip_magic_trailing_comma: bool, experimental_string_processing: bool, + preview: bool, quiet: bool, verbose: bool, required_version: Optional[str], @@ -469,6 +475,7 @@ def main( string_normalization=not skip_string_normalization, magic_trailing_comma=not skip_magic_trailing_comma, experimental_string_processing=experimental_string_processing, + preview=preview, ) if code is not None: @@ -526,6 +533,8 @@ def main( ) if verbose or not quiet: + if code is None and (verbose or report.change_count or report.failure_count): + out() out(error_msg if report.return_code else "All done! ✨ 🍰 ✨") if code is None: click.echo(str(report), err=True)