X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/a24e1f795975350f7b1d8898d831916a9f6dbc6a..8089aaad6b0116eb3a4758430129c3d8d900585b:/src/black/__init__.py diff --git a/src/black/__init__.py b/src/black/__init__.py index 6192f5c..8c28b6b 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -258,7 +258,7 @@ def validate_regex( "--preview", is_flag=True, help=( - "Enable potentially disruptive style changes that will be added to Black's main" + "Enable potentially disruptive style changes that may be added to Black's main" " functionality in the next major release." ), ) @@ -291,7 +291,8 @@ def validate_regex( type=str, help=( "Require a specific version of Black to be running (useful for unifying results" - " across many environments e.g. with a pyproject.toml file)." + " across many environments e.g. with a pyproject.toml file). It can be" + " either a major version number or an exact version." ), ) @click.option( @@ -474,7 +475,11 @@ def main( out(f"Using configuration in '{config}'.", fg="blue") error_msg = "Oh no! 💥 💔 💥" - if required_version and required_version != __version__: + if ( + required_version + and required_version != __version__ + and required_version != __version__.split(".")[0] + ): err( f"{error_msg} The required version `{required_version}` does not match" f" the running version `{__version__}`!"