Skip to content

Commit a46c33d

Browse files
committed
ci(pyproject.toml): strict check for invalid commit messages
1 parent 47beadc commit a46c33d

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ repos:
5757

5858
- repo: local
5959
hooks:
60+
- id: check-commit
61+
name: Check commit messages
62+
language: system
63+
pass_filenames: false
64+
entry: poetry check-commit
65+
6066
- id: format
6167
name: Format
6268
language: system

pyproject.toml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ lint.sequence = [
237237
{ cmd = "mypy commitizen/ tests/" },
238238
]
239239

240-
check-commit.help = "Check the commit message"
241-
check-commit.cmd = "cz -nr 3 check --rev-range origin/master.."
240+
check-commit.help = "Check the commit messages"
241+
check-commit.cmd = "cz --no-raise 3 check --rev-range origin/master.."
242242

243243
test.help = "Run the test suite"
244244
test.cmd = "pytest -n 3 --dist=loadfile"
@@ -250,12 +250,7 @@ cover.help = "Run the test suite with coverage"
250250
cover.ref = "test --cov-report term-missing --cov-report=xml:coverage.xml --cov=commitizen"
251251

252252
all.help = "Run all tasks"
253-
all.sequence = [
254-
"format",
255-
"lint",
256-
"cover",
257-
"check-commit",
258-
]
253+
all.sequence = ["check-commit", "format", "lint", "cover"]
259254

260255
"doc:screenshots".help = "Render documentation screenshots"
261256
"doc:screenshots".script = "scripts.gen_cli_help_screenshots:gen_cli_help_screenshots"
@@ -267,10 +262,7 @@ doc.help = "Live documentation server"
267262
doc.cmd = "mkdocs serve"
268263

269264
ci.help = "Run all tasks in CI"
270-
ci.sequence = [
271-
{ cmd = "pre-commit run --all-files" },
272-
"cover",
273-
]
265+
ci.sequence = [{ cmd = "pre-commit run --all-files" }, "cover"]
274266
ci.env = { SKIP = "no-commit-to-branch" }
275267

276268
setup-pre-commit.help = "Install pre-commit hooks"

0 commit comments

Comments
 (0)