From 4eb644d69d11c741be9f5b211736102602ef561e Mon Sep 17 00:00:00 2001 From: Jan K9f Date: Fri, 4 Apr 2025 07:31:25 +0200 Subject: [PATCH 1/2] feat(add-commitizen): Add commitizen to make it easier to commit in semantic commits --- .cz.toml | 5 +++++ .pre-commit-config.yaml | 8 ++++++++ 2 files changed, 13 insertions(+) create mode 100644 .cz.toml create mode 100644 .pre-commit-config.yaml diff --git a/.cz.toml b/.cz.toml new file mode 100644 index 0000000..26d453c --- /dev/null +++ b/.cz.toml @@ -0,0 +1,5 @@ +[tool.commitizen] +name = "cz_conventional_commits" +tag_format = "v$version" +version_scheme = "semver" +version_provider = "scm" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..3105af7 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,8 @@ +repos: +- hooks: + - id: commitizen + - id: commitizen-branch + stages: + - push + repo: https://github.com/commitizen-tools/commitizen + rev: v4.4.1 -- 2.47.2 From 7789bff83fc232ef7bca7050088520e6e45cc4fe Mon Sep 17 00:00:00 2001 From: Jan K9f Date: Fri, 4 Apr 2025 07:40:27 +0200 Subject: [PATCH 2/2] feat(commitizen): add commitizen docs --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index ce8b529..cd435eb 100644 --- a/README.md +++ b/README.md @@ -156,6 +156,16 @@ Where `` is one of: - `test`: Adding or refactoring tests - `chore`: Updating build tasks, etc; no production code change +You may use [commitizen](https://commitizen-tools.github.io/commitizen/) to automatically validate or write your commits: + +After installing [commitizen](https://commitizen-tools.github.io/commitizen/) you may commit with: +``` +cz c +``` +This will automatically ask you some questions and generate a semantic commit for you. + +You may additionally install [pre-commit](https://pre-commit.com/). This will automatically validate your commits before push and commiting. + Examples: ``` feat: add user balance display -- 2.47.2