Skip to content

Commit

Permalink
Create cliff.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
jimbrig authored Feb 27, 2024
1 parent c74182d commit 420e587
Showing 1 changed file with 100 additions and 0 deletions.
100 changes: 100 additions & 0 deletions .github/cliff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# configuration file for git-cliff (0.1.0)

[changelog]

# remove the leading and trailing whitespace from the template
trim = true

# header
header = """
# Changelog\n
> All notable changes to this project will be documented in this file. The format is based on
[Keep a Changelog](http://keepachangelog.com/) and this project adheres to
[Semantic Versioning](http://semver.org/).\n
"""

# body - see https://tera.netlify.app/docs/#introduction
body = """
{% if version %}\
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}\
## [Unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | upper_first }}
{% for commit in commits %}
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\
{% endfor %}
{% endfor %}\n
"""

# footer
footer = """
***
*Changelog generated by [git-cliff](https://github.com/orhun/git-cliff).*
***
"""

# commits
[git]
conventional_commits = true
filter_unconventional = true
filter_commits = true
tag_pattern = "v[0-9]*"
skip_tags = "v0.0.0.9999" # "v0.1.0-beta.1"
ignore_tags = ""
date_order = true
topo_order = true
sort_commits = "newest" # "oldest"
split_commits = false
protect_breaking_commits = true
# limit_commits = 42
commit_preprocessors = [
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/orhun/git-cliff/issues/${2}))" },
]
commit_parsers = [
{ message = "^feat", group = "Features" },
{ message = "^fix", group = "Bug Fixes" },
{ message = "^bug", group = "Bug Fixes" },
{ message = "^doc", group = "Documentation" },
{ message = "^docs", group = "Documentation" },
{ message = "^perf", group = "Performance" },
{ message = "^app", group = "Application" },
{ message = "^api", group = "API" },
{ message = "^data", group = "Data" },
{ message = "^db", group = "Database" },
{ message = "^refactor", group = "Refactoring" },
{ message = "^style", group = "Styling" },
{ message = "^test", group = "Testing" },
{ message = "^setup", group = "Setup" },
{ message = "^infra", group = "Infrastructure" },
{ message = "^meta", group = "Meta" },
{ message = "^config", group = "Configuration" },
{ message = "^design", group = "Design" },
{ message = "^clean", group = "Cleanup" },
{ message = "^unit", group = "Testing" },
{ message = "^enhance", group = "Features" },
{ message = "^cicd", group = "DevOps" },
{ message = "^config", group = "Configuration" },
{ message = "^deploy", group = "Deployment" },
{ message = "^chore\\(release\\): prepare for", skip = true },
{ message = "^chore", group = "Miscellaneous Tasks", skip = true },
{ body = ".*security", group = "Security" },
]


# ------------------------------------------------------------------------------
# parse the commits based on https://www.conventionalcommits.org
# filter out the commits that are not conventional
# process each line of a commit as an individual commit
# regex for preprocessing the commit messages
# regex for parsing and grouping commits
# protect breaking changes from being skipped due to matching a skipping commit_parser
# filter out the commits that are not matched by commit parsers
# glob pattern for matching git tags
# regex for skipping tags
# regex for ignoring tags
# sort the tags chronologically
# sort the commits inside sections by oldest/newest order
# limit the number of commits included in the changelog
# ------------------------------------------------------------------------------

0 comments on commit 420e587

Please sign in to comment.