Skip to content

Commit f73dabf

Browse files
committed
chore!: validate_table is now strict by default, and have better errors
1 parent 771d650 commit f73dabf

File tree

9 files changed

+2330
-59615
lines changed

9 files changed

+2330
-59615
lines changed

cliff.toml

Lines changed: 59 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,89 @@
1-
# configuration file for git-cliff
2-
# see https://github.com/orhun/git-cliff#configuration-file
1+
# git-cliff ~ configuration file
2+
# https://git-cliff.org/docs/configuration
33

44
[changelog]
5-
# changelog header
5+
# A Tera template to be rendered as the changelog's footer.
6+
# See https://keats.github.io/tera/docs/#introduction
67
header = """
78
# Changelog\n
8-
All notable changes to this project will be documented in this file.\n
9+
All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines.\n
910
"""
10-
# template for the changelog body
11-
# https://tera.netlify.app/docs/#introduction
12-
body = """
11+
# A Tera template to be rendered for each release in the changelog.
12+
# See https://keats.github.io/tera/docs/#introduction
13+
body = """\
1314
{% if version %}\
14-
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
15+
{% if previous.version %}\
16+
## [{{ version | trim_start_matches(pat="v") }}]($REPO/compare/{{ previous.version }}..{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
17+
{% else %}\
18+
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
19+
{% endif %}\
1520
{% else %}\
1621
## [unreleased]
1722
{% endif %}\
1823
{% for group, commits in commits | group_by(attribute="group") %}
19-
### {{ group | upper_first }}
20-
{% for commit in commits %}
21-
- {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}](https://github.com/ArkForgeLabs/Astra/commit/{{ commit.id }}))\
22-
{% endfor %}
24+
### {{ group | striptags | trim | upper_first }}
25+
{% for commit in commits
26+
| filter(attribute="scope")
27+
| sort(attribute="scope") %}
28+
- **({{commit.scope}})**{% if commit.breaking %} [**breaking**]{% endif %} \
29+
{{ commit.message }} - ([{{ commit.id | truncate(length=7, end="") }}]($REPO/commit/{{ commit.id }}))
30+
{%- endfor -%}
31+
{% raw %}\n{% endraw %}\
32+
{%- for commit in commits %}
33+
{%- if commit.scope -%}
34+
{% else -%}
35+
- {% if commit.breaking %}[**breaking**] {% endif %}\
36+
{{ commit.message }} - ([{{ commit.id | truncate(length=7, end="") }}]($REPO/commit/{{ commit.id }}))
37+
{% endif -%}
38+
{% endfor -%}
2339
{% endfor %}\n
2440
"""
25-
# remove the leading and trailing whitespace from the template
26-
trim = true
27-
# changelog footer
41+
# A Tera template to be rendered as the changelog's footer.
42+
# See https://keats.github.io/tera/docs/#introduction
2843
footer = """
2944
<!-- generated by git-cliff -->
3045
"""
46+
# Remove leading and trailing whitespaces from the changelog's body.
47+
trim = true
48+
# postprocessors
49+
postprocessors = [
50+
# Replace the placeholder `<REPO>` with a URL.
51+
{ pattern = '\$REPO', replace = "https://github.com/ArkForgeLabs/Astra" }, # replace repository URL
52+
]
3153

3254
[git]
33-
# parse the commits based on https://www.conventionalcommits.org
55+
# Parse commits according to the conventional commits specification.
56+
# See https://www.conventionalcommits.org
3457
conventional_commits = true
35-
# filter out the commits that are not conventional
58+
# Exclude commits that do not match the conventional commits specification.
3659
filter_unconventional = true
37-
# process each line of a commit as an individual commit
38-
split_commits = false
39-
# regex for preprocessing the commit messages
60+
# Split commits on newlines, treating each line as an individual commit.
61+
split_commits = true
62+
# An array of regex based parsers to modify commit messages prior to further processing.
4063
commit_preprocessors = [
41-
# { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/orhun/git-cliff/issues/${2}))"}, # replace issue numbers
64+
# Replace issue numbers with link templates to be updated in `changelog.postprocessors`.
65+
#{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/orhun/git-cliff/issues/${2}))"},
4266
]
43-
# regex for parsing and grouping commits
67+
# An array of regex based parsers for extracting data from the commit message.
68+
# Assigns commits to groups.
69+
# Optionally sets the commit's scope and can decide to exclude commits from further processing.
4470
commit_parsers = [
4571
{ message = "^feat", group = "Features" },
4672
{ message = "^fix", group = "Bug Fixes" },
4773
{ message = "^doc", group = "Documentation" },
4874
{ message = "^perf", group = "Performance" },
49-
{ message = "^refactor", group = "Refactor" },
50-
{ message = "^style", group = "Styling" },
51-
{ message = "^test", group = "Testing" },
52-
{ message = "^chore\\(release\\): prepare for", skip = true },
53-
{ message = "^chore", group = "Miscellaneous Tasks" },
75+
{ message = "^refactor", group = "Refactoring" },
76+
{ message = "^style", group = "Style" },
77+
{ message = "^revert", group = "Revert" },
78+
{ message = "^test", group = "Tests" },
79+
{ message = "^chore\\(version\\):", skip = true },
80+
{ message = "^chore", group = "Miscellaneous Chores" },
5481
{ body = ".*security", group = "Security" },
5582
]
56-
# protect breaking changes from being skipped due to matching a skipping commit_parser
57-
protect_breaking_commits = false
58-
# filter out the commits that are not matched by commit parsers
83+
# Exclude commits that are not matched by any commit parser.
5984
filter_commits = false
60-
# glob pattern for matching git tags
61-
tag_pattern = "v[0-9]*"
62-
# regex for skipping tags
63-
skip_tags = "v0.1.0-beta.1"
64-
# regex for ignoring tags
65-
ignore_tags = ""
66-
# sort the tags topologically
85+
# Order releases topologically instead of chronologically.
6786
topo_order = false
68-
# sort the commits inside sections by oldest/newest order
69-
sort_commits = "newest"
70-
# limit the number of commits included in the changelog.
71-
# limit_commits = 42
87+
# Order of commits in each group/release within the changelog.
88+
# Allowed values: newest, oldest
89+
sort_commits = "oldest"

0 commit comments

Comments
 (0)