ci(cz): add commitizen

Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
Matej Focko 2024-02-27 14:41:15 +01:00
parent 1fa1f6faa7
commit 18f722bff5
Signed by: mfocko
GPG key ID: 7C47D46246790496
2 changed files with 57 additions and 0 deletions

50
.cz.toml Normal file
View file

@ -0,0 +1,50 @@
[tool]
[tool.commitizen]
name = "cz_customize"
tag_format = "$version"
version_scheme = "semver"
version = "0.0.1"
update_changelog_on_bump = true
major_version_zero = true
[tool.commitizen.customize]
message_template = """\
{{change_type}}{% if scope %}({{scope}}){% endif %}: {{subject}}\
{% if body %}\n\n{{body}}{% endif %}
"""
example = "seminar(01): add changes from seminar"
schema = "typeoptional scope: message\n\nbody"
schema_pattern = """\
(?s)\
(chore|feat|fix|ci|style|algorithms|automata|blog|c|cpp|foundations|functional)\
(\\(\\S+\\))?!?:\
( [^\\n\\r]+)\
((\\n\\n.*)|(\\s*))?$\
"""
[[tool.commitizen.customize.questions]]
type = "list"
name = "change_type"
choices = [
"chore", "feat", "fix", "ci", "style",
"blog",
"algorithms", "automata", "functional",
"c", "cpp", "foundations",
]
message = "Select the type of change you are commiting"
[[tool.commitizen.customize.questions]]
type = "input"
name = "scope"
message = "What is the scope of this change? (e.g., KB area, blog or area of change): (press [enter] to skip)"
[[tool.commitizen.customize.questions]]
type = "input"
name = "subject"
message = "Write a short and imperative summary of the code changes: (lower case and no period)"
[[tool.commitizen.customize.questions]]
type = "input"
name = "body"
message = "Provide additional contextual information about the code changes: (press [enter] to skip)"

View file

@ -15,3 +15,10 @@ repos:
rev: v3.1.0
hooks:
- id: prettier
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.15.0
hooks:
- id: commitizen
- id: commitizen-branch
stages:
- push