diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bda2544ed6..95dcbe576b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: - id: no-commit-to-branch - repo: https://github.com/commitizen-tools/commitizen - rev: v2.27.0 # automatically updated by Commitizen + rev: v2.27.1 # automatically updated by Commitizen hooks: - id: commitizen stages: [commit-msg] diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 956f15250e..b32bc56e36 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -1,8 +1,9 @@ - id: commitizen name: commitizen check description: "Check whether the commit message follows commiting rules" - entry: cz check --commit-msg-file + entry: cz check + args: [--allow-abort, --commit-msg-file] + stages: [commit-msg] language: python language_version: python3 - require_serial: true - minimum_pre_commit_version: "0.15.4" + minimum_pre_commit_version: "1.4.3" diff --git a/CHANGELOG.md b/CHANGELOG.md index a4c4b09f36..7b9e7d6a46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,13 @@ +## v2.27.1 (2022-05-22) + +### Fix + +- **pre-commit**: Use new --allow-abort option +- **pre-commit**: Confine hook to commit-msg stage +- **pre-commit**: Set min pre-commit to v1.4.3 +- **pre-commit**: Don't require serial execution + ## v2.27.0 (2022-05-16) ### Feat diff --git a/commitizen/__version__.py b/commitizen/__version__.py index 07150ef8e0..45aa9f0ab2 100644 --- a/commitizen/__version__.py +++ b/commitizen/__version__.py @@ -1 +1 @@ -__version__ = "2.27.0" +__version__ = "2.27.1" diff --git a/commitizen/commands/init.py b/commitizen/commands/init.py index d290612949..73d76e9022 100644 --- a/commitizen/commands/init.py +++ b/commitizen/commands/init.py @@ -114,7 +114,7 @@ def _install_pre_commit_hook(self): cz_hook_config = { "repo": "https://github.com/commitizen-tools/commitizen", "rev": f"v{__version__}", - "hooks": [{"id": "commitizen", "stages": ["commit-msg"]}], + "hooks": [{"id": "commitizen"}], } config_data = {} diff --git a/docs/README.md b/docs/README.md index f459ccfa28..9a99d11fd1 100644 --- a/docs/README.md +++ b/docs/README.md @@ -111,7 +111,6 @@ repos: rev: master hooks: - id: commitizen - stages: [commit-msg] ``` After the configuration is added, you'll need to run diff --git a/docs/auto_check.md b/docs/auto_check.md index 755f1af8b7..fc76bdf88b 100644 --- a/docs/auto_check.md +++ b/docs/auto_check.md @@ -22,7 +22,6 @@ repos: rev: v1.17.0 hooks: - id: commitizen - stages: [commit-msg] ``` * Step 3: Install the configuration into git hook through `pre-commit` @@ -51,7 +50,7 @@ Open the file and edit it: ```sh #!/bin/bash MSG_FILE=$1 -cz check --commit-msg-file $MSG_FILE +cz check --allow-abort --commit-msg-file $MSG_FILE ``` Where `$1` is the name of the temporary file that contains the current commit message. To be more explicit, the previous variable is stored in another variable called `$MSG_FILE`, for didactic purposes. diff --git a/pyproject.toml b/pyproject.toml index f9766220e1..b1d48db955 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [tool.commitizen] -version = "2.27.0" +version = "2.27.1" tag_format = "v$version" version_files = [ "pyproject.toml:version", @@ -30,7 +30,7 @@ exclude = ''' [tool.poetry] name = "commitizen" -version = "2.27.0" +version = "2.27.1" description = "Python commitizen client tool" authors = ["Santiago Fraire "] license = "MIT" diff --git a/tests/commands/test_init_command.py b/tests/commands/test_init_command.py index e7f2c00edf..131aaaad44 100644 --- a/tests/commands/test_init_command.py +++ b/tests/commands/test_init_command.py @@ -21,7 +21,7 @@ def ask(self): cz_hook_config = { "repo": "https://github.com/commitizen-tools/commitizen", "rev": f"v{__version__}", - "hooks": [{"id": "commitizen", "stages": ["commit-msg"]}], + "hooks": [{"id": "commitizen"}], } expected_config = (