Skip to content

Commit 9bbe486

Browse files
authored
Merge pull request #706 from mih/custom-changelog
Custom changelog
2 parents 789ff66 + 65a4b8c commit 9bbe486

File tree

3 files changed

+61
-1
lines changed

3 files changed

+61
-1
lines changed

.changelog.md.j2

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{% for entry in tree %}
2+
3+
## {{ entry.version }}{% if entry.date %} ({{ entry.date }}){% endif %}
4+
5+
{% for change_key, changes in entry.changes.items() %}
6+
7+
{% if change_key %}
8+
### {{ change_key }}
9+
{% endif %}
10+
11+
{% for change in changes %}
12+
{% if change.scope %}
13+
- {{ change.scope }}: {{ change.message }} [{{ change.sha1 | truncate(8, true, '') }}]
14+
{% elif change.message %}
15+
- {{ change.message }} [{{ change.sha1 | truncate(8, true, '') }}]
16+
{% endif %}
17+
{% endfor %}
18+
{% endfor %}
19+
{% endfor %}

CHANGELOG.md

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
## 1.4.1 (2024-05-22)
2+
3+
### 🐛 Bug Fixes
4+
5+
- dependencies: limit test patch import to test runs [905b99bd]
6+
7+
### 📝 Documentation
8+
9+
- add note of Git >= v2.31 requirement for next-status [093575d8]
10+
- state conventional-commits requirement [a9180fc0]
11+
12+
### 🛡 Tests
13+
14+
- fixture: add missing import (for non-WebDAV fallback) [ddd66799]
15+
116
# 1.4.0 (2024-05-17)
217

318
## 🐛 Bug Fixes

pyproject.toml

+27-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,36 @@
22
requires = ["setuptools >= 43.0.0", "wheel"]
33

44
[tool.commitizen]
5-
name = "cz_conventional_commits"
5+
name = "cz_customize"
66
tag_format = "$version"
77
version_scheme = "pep440"
88
version_provider = "scm"
9+
changelog_incremental = true
10+
template = ".changelog.md.j2"
11+
gpg_sign = true
12+
13+
[tool.commitizen.customize]
14+
commit_parser = "^((?P<change_type>feat|fix|rf|perf|test|docs|BREAKING CHANGE)(?:\\((?P<scope>[^()\r\n]*)\\)|\\()?(?P<breaking>!)?|\\w+!):\\s(?P<message>.*)?(?P<body>.*)?"
15+
change_type_order = ["BREAKING CHANGE", "feat", "fix", "rf", "perf", "docs", "test"]
16+
changelog_pattern = "^((BREAKING[\\-\\ ]CHANGE|\\w+)(\\(.+\\))?!?):"
17+
bump_pattern = "^((BREAKING[\\-\\ ]CHANGE|\\w+)(\\(.+\\))?!?):"
18+
schema_pattern = "(?s)(ci|docs|feat|fix|perf|rf|style|test|chore|revert|bump)(\\(\\S+\\))?!?:( [^\\n\\r]+)((\\n\\n.*)|(\\s*))?$"
19+
20+
[tool.commitizen.customize.bump_map]
21+
"^\\w+!" = "MAJOR"
22+
"^BREAKING" = "MAJOR"
23+
"^feat" = "MINOR"
24+
"^fix" = "PATCH"
25+
26+
[tool.commitizen.customize.change_type_map]
27+
"BREAKING CHANGE" = "Breaking changes"
28+
docs = "📝 Documentation"
29+
feat = "💫 New features"
30+
fix = "🐛 Bug Fixes"
31+
test = "🛡 Tests"
32+
rf = "Refactorings"
33+
perf = "Performance improvements"
34+
935

1036
[tool.pytest.ini_options]
1137
addopts = "--strict-markers"

0 commit comments

Comments
 (0)