Skip to content

Commit

Permalink
Merge pull request #706 from mih/custom-changelog
Browse files Browse the repository at this point in the history
Custom changelog
  • Loading branch information
mih authored May 21, 2024
2 parents 789ff66 + 65a4b8c commit 9bbe486
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 1 deletion.
19 changes: 19 additions & 0 deletions .changelog.md.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{% for entry in tree %}

## {{ entry.version }}{% if entry.date %} ({{ entry.date }}){% endif %}

{% for change_key, changes in entry.changes.items() %}

{% if change_key %}
### {{ change_key }}
{% endif %}

{% for change in changes %}
{% if change.scope %}
- {{ change.scope }}: {{ change.message }} [{{ change.sha1 | truncate(8, true, '') }}]
{% elif change.message %}
- {{ change.message }} [{{ change.sha1 | truncate(8, true, '') }}]
{% endif %}
{% endfor %}
{% endfor %}
{% endfor %}
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
## 1.4.1 (2024-05-22)

### 🐛 Bug Fixes

- dependencies: limit test patch import to test runs [905b99bd]

### 📝 Documentation

- add note of Git >= v2.31 requirement for next-status [093575d8]
- state conventional-commits requirement [a9180fc0]

### 🛡 Tests

- fixture: add missing import (for non-WebDAV fallback) [ddd66799]

# 1.4.0 (2024-05-17)

## 🐛 Bug Fixes
Expand Down
28 changes: 27 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,36 @@
requires = ["setuptools >= 43.0.0", "wheel"]

[tool.commitizen]
name = "cz_conventional_commits"
name = "cz_customize"
tag_format = "$version"
version_scheme = "pep440"
version_provider = "scm"
changelog_incremental = true
template = ".changelog.md.j2"
gpg_sign = true

[tool.commitizen.customize]
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>.*)?"
change_type_order = ["BREAKING CHANGE", "feat", "fix", "rf", "perf", "docs", "test"]
changelog_pattern = "^((BREAKING[\\-\\ ]CHANGE|\\w+)(\\(.+\\))?!?):"
bump_pattern = "^((BREAKING[\\-\\ ]CHANGE|\\w+)(\\(.+\\))?!?):"
schema_pattern = "(?s)(ci|docs|feat|fix|perf|rf|style|test|chore|revert|bump)(\\(\\S+\\))?!?:( [^\\n\\r]+)((\\n\\n.*)|(\\s*))?$"

[tool.commitizen.customize.bump_map]
"^\\w+!" = "MAJOR"
"^BREAKING" = "MAJOR"
"^feat" = "MINOR"
"^fix" = "PATCH"

[tool.commitizen.customize.change_type_map]
"BREAKING CHANGE" = "Breaking changes"
docs = "📝 Documentation"
feat = "💫 New features"
fix = "🐛 Bug Fixes"
test = "🛡 Tests"
rf = "Refactorings"
perf = "Performance improvements"


[tool.pytest.ini_options]
addopts = "--strict-markers"
Expand Down

0 comments on commit 9bbe486

Please sign in to comment.