|
| 1 | +# from: https://github.com/orhun/git-cliff/blob/main/cliff.toml |
| 2 | + |
| 3 | +[changelog] |
| 4 | +trim = true |
| 5 | +postprocessors = [{ pattern = '<REPO>', replace = "https://github.com/vladkens/ghstats" }] |
| 6 | +body = """ |
| 7 | +{%- macro remote_url() -%} |
| 8 | + https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} |
| 9 | +{%- endmacro -%} |
| 10 | +
|
| 11 | +{% macro print_commit(commit) -%} |
| 12 | + - {% if commit.scope %}*({{ commit.scope }})* {% endif %}\ |
| 13 | + {% if commit.breaking %}[**breaking**] {% endif %}\ |
| 14 | + {{ commit.message | upper_first }} - \ |
| 15 | + ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ |
| 16 | +{% endmacro -%} |
| 17 | +
|
| 18 | +{% if version %}\ |
| 19 | + {% if previous.version %}\ |
| 20 | + ## [{{ version | trim_start_matches(pat="v") }}]\ |
| 21 | + ({{ self::remote_url() }}/compare/{{ previous.version }}..{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }} |
| 22 | + {% else %}\ |
| 23 | + ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} |
| 24 | + {% endif %}\ |
| 25 | +{% else %}\ |
| 26 | + ## [unreleased] |
| 27 | +{% endif %}\ |
| 28 | +
|
| 29 | +{% for group, commits in commits | group_by(attribute="group") %} |
| 30 | + ### {{ group | striptags | trim | upper_first }} |
| 31 | + {% for commit in commits |
| 32 | + | filter(attribute="scope") |
| 33 | + | sort(attribute="scope") %} |
| 34 | + {{ self::print_commit(commit=commit) }} |
| 35 | + {%- endfor %} |
| 36 | + {% for commit in commits %} |
| 37 | + {%- if not commit.scope -%} |
| 38 | + {{ self::print_commit(commit=commit) }} |
| 39 | + {% endif -%} |
| 40 | + {% endfor -%} |
| 41 | +{% endfor -%} |
| 42 | +{%- if github -%} |
| 43 | +{% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %} |
| 44 | + ## New Contributors ❤️ |
| 45 | +{% endif %}\ |
| 46 | +{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %} |
| 47 | + * @{{ contributor.username }} made their first contribution |
| 48 | + {%- if contributor.pr_number %} in \ |
| 49 | + [#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \ |
| 50 | + {%- endif %} |
| 51 | +{%- endfor -%} |
| 52 | +{%- endif %} |
| 53 | +""" |
| 54 | + |
| 55 | +[git] |
| 56 | +conventional_commits = true |
| 57 | +filter_unconventional = true |
| 58 | +split_commits = false |
| 59 | +filter_commits = false |
| 60 | +tag_pattern = "v[0-9].*" |
| 61 | +topo_order = false |
| 62 | +sort_commits = "newest" |
| 63 | +commit_preprocessors = [ |
| 64 | + { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))" }, |
| 65 | +] |
| 66 | +commit_parsers = [ |
| 67 | + { message = "^feat", group = "<!-- 0 --> Features" }, |
| 68 | + { message = "^fix", group = "<!-- 1 --> Bug Fixes" }, |
| 69 | + { message = "^chore", group = "<!-- 2 --> Other" }, |
| 70 | + { message = "^ci", skip = true }, |
| 71 | +] |
0 commit comments