X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/bbe1bdf1edfedf51b40824c5574413c0b1b35284..862c6f2c0c99b34731bd1e8812297fd2803e6a8b:/src/black/__init__.py?ds=sidebyside diff --git a/src/black/__init__.py b/src/black/__init__.py index 6a703e4..8c28b6b 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -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__}`!"