1
0
Fork 0
mirror of https://gitlab.com/mfocko/LeetCode.git synced 2024-09-19 17:56:55 +02:00

ci(cz): add commitizen

Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
Matej Focko 2024-02-22 16:51:33 +01:00
parent ebbb9edfb8
commit 457b0a97ec
Signed by: mfocko
GPG key ID: 7C47D46246790496
2 changed files with 33 additions and 0 deletions

26
.cz.toml Normal file
View file

@ -0,0 +1,26 @@
[tool]
[tool.commitizen]
name = "cz_customize"
[tool.commitizen.customize]
message_template = "{{type_lang}}: add «{{problem}}»"
example = "cpp: add «997. Find the Town Judge»"
schema = "type_lang: message"
schema_pattern = """\
(?s)\
(chore|ci|cpp|cs|go|java|js|kt|rb|rs|swift)\
(\\(\\S+\\))?!?:\
( [^\\n\\r]+)\
((\\n\\n.*)|(\\s*))?$\
"""
[[tool.commitizen.customize.questions]]
type = "list"
name = "type_lang"
choices = ["cpp", "cs", "go", "java", "js", "kt", "rb", "rs", "swift", "chore", "ci"]
message = "Select the language (or type of change) you are commiting"
[[tool.commitizen.customize.questions]]
type = "input"
name = "problem"
message = "Type the problem name in form of: number. Name"

View file

@ -15,3 +15,10 @@ repos:
files: \.rs$
- id: clang-format
files: \.cpp$
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.15.0
hooks:
- id: commitizen
- id: commitizen-branch
stages:
- push