# git-cliff ~ configuration file # https://git-cliff.org/docs/configuration [remote.github] owner = "alex-karpenko" repo = "kube-lease-manager" [changelog] # changelog header header = """ # Changelog\n All notable changes to this project will be documented in this file. """ # 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 -%} {% if version -%} ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} {% else -%} ## [Unreleased] {% endif -%} ### Details\ {% if commits|filter(attribute="breaking", value=true)|length > 0 %} #### Breaking changes {% endif -%} {% for commit in commits|filter(attribute="breaking", value=true) -%} - {{ commit.message | upper_first | trim }}\ {% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif -%} {% if commit.remote.pr_number %} in \ [#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.remote.pr_number }}) \ {%- endif %} {% endfor -%}\ {% for group, commits in commits | group_by(attribute="group") %} #### {{ group | upper_first }} {%- for commit in commits %}\ {% if not commit.breaking %} - {{ commit.message | upper_first | trim }}\ {% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif -%} {% if commit.remote.pr_number %} in \ [#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.remote.pr_number }}) \ {%- endif -%} {%- endif -%} {% endfor %} {% endfor %} {%- 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 %} """ # template for the changelog footer footer = """ {%- macro remote_url() -%} https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} {%- endmacro -%} {% for release in releases -%} {% if release.version -%} {% if release.previous.version -%} [{{ release.version | trim_start_matches(pat="v") }}]: \ {{ self::remote_url() }}/compare/{{ release.previous.version }}..{{ release.version }} {% endif -%} {% else -%} [unreleased]: {{ self::remote_url() }}/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 = true # process each line of a commit as an individual commit split_commits = false # regex for preprocessing the commit messages commit_preprocessors = [ # remove issue numbers from commits { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" }, ] # regex for parsing and grouping commits commit_parsers = [ { message = "^.*: [Aa]dd", group = "Added" }, { message = "^.*: [Ii]mplement", group = "Added" }, { message = "^.*: support", group = "Added" }, { message = "^.*: [Rr]emove", group = "Removed" }, { message = "^.*: [Dd]elete", group = "Removed" }, { message = "^test", group = "Fixed" }, { message = "^fix", group = "Fixed" }, { message = "^.*: [Ff]ix", group = "Fixed" }, { message = "^.*", group = "Changed" }, ] # protect breaking changes from being skipped due to matching a skipping commit_parser protect_breaking_commits = true # filter out the commits that are not matched by commit parsers filter_commits = true # regex for matching git tags tag_pattern = "v[0-9].*" # regex for skipping tags skip_tags = "v0.1.0-beta.1" # regex for ignoring tags ignore_tags = "" # sort the tags topologically topo_order = false # sort the commits inside sections by oldest/newest order sort_commits = "oldest"