[changelog] # changelog header header = """ # Changelog\n """ # template for the changelog body # https://keats.github.io/tera/docs/#introduction body = """ {%- macro remote_url() -%} https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} {%- endmacro -%} {% macro print_commit(commit) -%} - {% if commit.scope %}**{{ commit.scope }}**: {% endif %}\ {% if commit.breaking %}[*breaking*] {% endif %}\ {{ commit.message | upper_first }} - \ ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\ {% endmacro -%} {% 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 | striptags | trim | upper_first }} {% for commit in commits | filter(attribute="scope") | sort(attribute="scope") %} {{ self::print_commit(commit=commit) }} {%- endfor %} {% for commit in commits %} {%- if not commit.scope -%} {{ self::print_commit(commit=commit) }} {% endif -%} {% endfor -%} {% endfor %} {%- if github -%} {% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %} ## New Contributors ❤️ {% endif %}\ {% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %} * @{{ contributor.username }} made their first contribution {%- if contributor.pr_number %} in \ [#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \ {%- endif %} {%- endfor -%} {%- endif %} """ # template for the changelog footer footer = """ {% for release in releases -%} {% if release.version -%} {% if release.previous.version -%} [{{ release.version | trim_start_matches(pat="v") }}]: \ https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}\ /compare/{{ release.previous.version }}..{{ release.version }} {% endif -%} {% else -%} [unreleased]: https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}\ /compare/{{ release.previous.version }}..HEAD {% endif -%} {% endfor %} """ # remove the leading and trailing whitespace from the templates trim = true [git] # parse the commits based on https://www.conventionalcommits.org conventional_commits = true # filter out the commits that are not conventional filter_unconventional = false # process each line of a commit as an individual commit split_commits = false # regex for parsing and grouping commits commit_parsers = [ { message = "!:", group = "Breaking" }, { message = "^feat", group = "Features" }, { message = "^fix", group = "Bug Fixes" }, { message = "^perf", group = "Performance" }, { message = "^doc", group = "Documentation" }, { message = "^refactor", skip = true }, { message = "^style", skip = true }, { message = "^chore", skip = true }, { message = ".*", group = "Other" }, ] # filter out the commits that are not matched by commit parsers filter_commits = true # sort the tags topologically topo_order = false # sort the commits inside sections by oldest/newest order sort_commits = "oldest" [remote.github] owner = "stackmystack" repo = "tsdl"