|
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 |
3 | 3 |
|
4 | 4 | [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 |
6 | 7 | header = """ |
7 | 8 | # 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 |
9 | 10 | """ |
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 = """\ |
13 | 14 | {% 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 %}\ |
15 | 20 | {% else %}\ |
16 | 21 | ## [unreleased] |
17 | 22 | {% endif %}\ |
18 | 23 | {% 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 -%} |
23 | 39 | {% endfor %}\n |
24 | 40 | """ |
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 |
28 | 43 | footer = """ |
29 | 44 | <!-- generated by git-cliff --> |
30 | 45 | """ |
| 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 | +] |
31 | 53 |
|
32 | 54 | [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 |
34 | 57 | conventional_commits = true |
35 | | -# filter out the commits that are not conventional |
| 58 | +# Exclude commits that do not match the conventional commits specification. |
36 | 59 | 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. |
40 | 63 | 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}))"}, |
42 | 66 | ] |
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. |
44 | 70 | commit_parsers = [ |
45 | 71 | { message = "^feat", group = "Features" }, |
46 | 72 | { message = "^fix", group = "Bug Fixes" }, |
47 | 73 | { message = "^doc", group = "Documentation" }, |
48 | 74 | { 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" }, |
54 | 81 | { body = ".*security", group = "Security" }, |
55 | 82 | ] |
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. |
59 | 84 | 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. |
67 | 86 | 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