X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/f61299a62a330dd26d180a8ea420916870f19730..cae7ae3a4d32dc51e0752d4a4e885a7792a0286d:/src/black/__init__.py?ds=inline 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__}`!"