From 74d92d2873b21fe47e38f3f9a933aea634ff015a Mon Sep 17 00:00:00 2001 From: Yu-Ting Hsiung Date: Mon, 2 Jun 2025 13:33:19 +0800 Subject: [PATCH 1/5] ci(pyproject.toml): strict check for invalid commit messages --- pyproject.toml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a653ecdb5d..538673f1a9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -237,8 +237,8 @@ lint.sequence = [ { cmd = "mypy commitizen/ tests/" }, ] -check-commit.help = "Check the commit message" -check-commit.cmd = "cz -nr 3 check --rev-range origin/master.." +check-commit.help = "Check the commit messages" +check-commit.cmd = "poetry run cz --no-raise 3 check --rev-range origin/master.." test.help = "Run the test suite" test.cmd = "pytest -n 3 --dist=loadfile" @@ -250,12 +250,7 @@ cover.help = "Run the test suite with coverage" cover.ref = "test --cov-report term-missing --cov-report=xml:coverage.xml --cov=commitizen" all.help = "Run all tasks" -all.sequence = [ - "format", - "lint", - "cover", - "check-commit", -] +all.sequence = ["check-commit", "format", "lint", "cover"] "doc:screenshots".help = "Render documentation screenshots" "doc:screenshots".script = "scripts.gen_cli_help_screenshots:gen_cli_help_screenshots" @@ -267,10 +262,7 @@ doc.help = "Live documentation server" doc.cmd = "mkdocs serve" ci.help = "Run all tasks in CI" -ci.sequence = [ - { cmd = "pre-commit run --all-files" }, - "cover", -] +ci.sequence = ["check-commit", { cmd = "pre-commit run --all-files" }, "cover"] ci.env = { SKIP = "no-commit-to-branch" } setup-pre-commit.help = "Install pre-commit hooks" From e192688a40bdbcd39a4f015d12fb26530b0fbde2 Mon Sep 17 00:00:00 2001 From: Yu-Ting Hsiung Date: Mon, 2 Jun 2025 14:30:22 +0800 Subject: [PATCH 2/5] docs(pyproject.toml): move check-commit before cover --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 538673f1a9..3ed16a807b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -250,7 +250,7 @@ cover.help = "Run the test suite with coverage" cover.ref = "test --cov-report term-missing --cov-report=xml:coverage.xml --cov=commitizen" all.help = "Run all tasks" -all.sequence = ["check-commit", "format", "lint", "cover"] +all.sequence = ["format", "lint", "check-commit", "cover"] "doc:screenshots".help = "Render documentation screenshots" "doc:screenshots".script = "scripts.gen_cli_help_screenshots:gen_cli_help_screenshots" From 81c4fbe42732033db252f8dc564bb0e0210d2921 Mon Sep 17 00:00:00 2001 From: Yu-Ting Hsiung Date: Mon, 2 Jun 2025 13:35:31 +0800 Subject: [PATCH 3/5] invalid commit message From 39f5bbe0686260f4d24561e56a384d16fd577986 Mon Sep 17 00:00:00 2001 From: Yu-Ting Hsiung Date: Mon, 2 Jun 2025 13:35:48 +0800 Subject: [PATCH 4/5] build: valid commit message From e8ba49b87790921c0235cf655dd1f22835372e61 Mon Sep 17 00:00:00 2001 From: Yu-Ting Hsiung Date: Mon, 2 Jun 2025 14:27:36 +0800 Subject: [PATCH 5/5] feat: valid