|
1 | 1 | # git-cliff ~ configuration file
|
2 | 2 | # https://git-cliff.org/docs/configuration
|
3 | 3 |
|
4 |
| -# [remote.github] |
5 |
| -# owner = "flaviodelgrosso" |
6 |
| -# repo = "pushapp" |
7 |
| -# token = "" |
| 4 | +[remote] |
| 5 | +# the remote repository |
| 6 | +github = { owner = "flaviodelgrosso", repo = "pushapp" } |
8 | 7 |
|
9 | 8 | [changelog]
|
| 9 | +# template for the changelog header |
10 | 10 | header = """
|
11 | 11 | # Changelog\n
|
12 | 12 | All notable changes to this project will be documented in this file.
|
13 |
| -This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n |
14 |
| -""" |
15 | 13 |
|
| 14 | +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), |
| 15 | +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n |
| 16 | +""" |
16 | 17 | # template for the changelog body
|
17 | 18 | # https://keats.github.io/tera/docs/#introduction
|
18 | 19 | body = """
|
19 |
| -## What's Changed |
| 20 | +{%- macro remote_url() -%} |
| 21 | + https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} |
| 22 | +{%- endmacro -%} |
20 | 23 |
|
21 |
| -{%- if version %} in {{ version }}{%- endif -%} |
22 |
| -{% for commit in commits %} |
23 |
| - {% if commit.remote.pr_title -%} |
24 |
| - {%- set commit_message = commit.remote.pr_title -%} |
25 |
| - {%- else -%} |
26 |
| - {%- set commit_message = commit.message -%} |
27 |
| - {%- endif -%} |
28 |
| - * {{ commit_message | split(pat="\n") | first | trim }}\ |
29 |
| - {% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif -%} |
30 |
| - {% if commit.remote.pr_number %} in \ |
31 |
| - [#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.remote.pr_number }}) \ |
32 |
| - {%- endif %} |
33 |
| -{%- endfor -%} |
| 24 | +{% if version -%} |
| 25 | + ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} |
| 26 | +{% else -%} |
| 27 | + ## [Unreleased] |
| 28 | +{% endif -%} |
| 29 | +
|
| 30 | +{% for group, commits in commits | group_by(attribute="group") %} |
| 31 | + ### {{ group | upper_first }} |
| 32 | + {%- for commit in commits %} |
| 33 | + - {{ commit.message | split(pat="\n") | first | upper_first | trim }}\ |
| 34 | + {% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif -%} |
| 35 | + {% if commit.remote.pr_number %} in \ |
| 36 | + [#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.remote.pr_number }}) \ |
| 37 | + {%- endif -%} |
| 38 | + {% endfor %} |
| 39 | +{% endfor %} |
34 | 40 |
|
35 |
| -{%- if github -%} |
36 |
| -{% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %} |
37 |
| - {% raw %}\n{% endraw -%} |
| 41 | +{%- if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %} |
38 | 42 | ## New Contributors
|
39 |
| -{%- endif %}\ |
| 43 | +{%- endif -%} |
| 44 | +
|
40 | 45 | {% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
|
41 | 46 | * @{{ contributor.username }} made their first contribution
|
42 | 47 | {%- if contributor.pr_number %} in \
|
43 | 48 | [#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \
|
44 | 49 | {%- endif %}
|
45 |
| -{%- endfor -%} |
46 |
| -{%- endif -%} |
47 |
| -
|
48 |
| -{% if version %} |
49 |
| - {% if previous.version %} |
50 |
| - **Full Changelog**: {{ self::remote_url() }}/compare/{{ previous.version }}...{{ version }} |
51 |
| - {% endif %} |
52 |
| -{% else -%} |
53 |
| - {% raw %}\n{% endraw %} |
54 |
| -{% endif %} |
55 |
| -
|
56 |
| -{%- macro remote_url() -%} |
57 |
| - https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} |
58 |
| -{%- endmacro -%} |
| 50 | +{%- endfor %}\n |
59 | 51 | """
|
60 |
| -# remove the leading and trailing whitespace from the template |
61 |
| -trim = true |
62 | 52 | # template for the changelog footer
|
63 | 53 | footer = """
|
| 54 | +{%- macro remote_url() -%} |
| 55 | + https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} |
| 56 | +{%- endmacro -%} |
| 57 | +
|
| 58 | +{% for release in releases -%} |
| 59 | + {% if release.version -%} |
| 60 | + {% if release.previous.version -%} |
| 61 | + [{{ release.version | trim_start_matches(pat="v") }}]: \ |
| 62 | + {{ self::remote_url() }}/compare/{{ release.previous.version }}..{{ release.version }} |
| 63 | + {% endif -%} |
| 64 | + {% else -%} |
| 65 | + [unreleased]: {{ self::remote_url() }}/compare/{{ release.previous.version }}..HEAD |
| 66 | + {% endif -%} |
| 67 | +{% endfor %} |
64 | 68 | <!-- generated by git-cliff -->
|
65 | 69 | """
|
66 |
| -# postprocessors |
67 |
| -postprocessors = [] |
| 70 | +# remove the leading and trailing whitespace from the templates |
| 71 | +trim = true |
68 | 72 |
|
69 | 73 | [git]
|
70 | 74 | # parse the commits based on https://www.conventionalcommits.org
|
71 |
| -conventional_commits = false |
| 75 | +conventional_commits = true |
72 | 76 | # filter out the commits that are not conventional
|
73 |
| -filter_unconventional = true |
74 |
| -# process each line of a commit as an individual commit |
75 |
| -split_commits = false |
| 77 | +filter_unconventional = false |
76 | 78 | # regex for preprocessing the commit messages
|
77 | 79 | commit_preprocessors = [
|
78 |
| - # remove issue numbers from commits |
79 |
| - { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" }, |
| 80 | + # remove issue numbers from commits |
| 81 | + { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" }, |
| 82 | +] |
| 83 | +# regex for parsing and grouping commits |
| 84 | +commit_parsers = [ |
| 85 | + { message = "^[a|A]dd", group = "Added" }, |
| 86 | + { message = "^[s|S]upport", group = "Added" }, |
| 87 | + { message = "^[r|R]emove", group = "Removed" }, |
| 88 | + { message = "^.*: add", group = "Added" }, |
| 89 | + { message = "^.*: support", group = "Added" }, |
| 90 | + { message = "^.*: remove", group = "Removed" }, |
| 91 | + { message = "^.*: delete", group = "Removed" }, |
| 92 | + { message = "^test", group = "Fixed" }, |
| 93 | + { message = "^fix", group = "Fixed" }, |
| 94 | + { message = "^.*: fix", group = "Fixed" }, |
| 95 | + { message = "^.*", group = "Changed" }, |
80 | 96 | ]
|
81 | 97 | # filter out the commits that are not matched by commit parsers
|
82 | 98 | filter_commits = false
|
|
0 commit comments