From baf94062abff2755b9dd9320b3ab4eb8f59011a3 Mon Sep 17 00:00:00 2001 From: Yu-Ting Hsiung Date: Mon, 2 Jun 2025 13:33:19 +0800 Subject: [PATCH 1/2] ci(pyproject.toml): strict check for invalid commit messages --- pyproject.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ee0ecc9ce..58425a81a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -249,8 +249,8 @@ lint.sequence = [ { cmd = "mypy" }, ] -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" @@ -262,7 +262,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" @@ -274,7 +274,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 c18d8aa288aaed3f12b74d18ce4f4ccb33b58055 Mon Sep 17 00:00:00 2001 From: Yu-Ting Hsiung Date: Mon, 2 Jun 2025 14:30:22 +0800 Subject: [PATCH 2/2] 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 58425a81a..1de17464a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -262,7 +262,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"