X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/521d1b8129c2d83b4ab49270fe7473802259c2a2..9bd4134f3138448eb92af7031d994b2cec7d08ad:/src/black/__init__.py diff --git a/src/black/__init__.py b/src/black/__init__.py index cfa2c76..405a010 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -246,6 +246,14 @@ def validate_regex( " Currently disabled because it leads to some crashes." ), ) +@click.option( + "--preview", + is_flag=True, + help=( + "Enable potentially disruptive style changes that will be added to Black's main" + " functionality in the next major release." + ), +) @click.option( "--check", is_flag=True, @@ -399,6 +407,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 +478,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 +536,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)