cliff.toml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # configuration file for git-cliff
  2. [changelog]
  3. # changelog header
  4. header = """
  5. # Changelog\n
  6. For notable changes, see runtime/doc/news.txt (or `:help news` in Nvim).\n
  7. Following is a list of fixes/features commits.\n
  8. """
  9. # template for the changelog body
  10. # https://github.com/Keats/tera
  11. # https://keats.github.io/tera/docs/
  12. body = """
  13. {% if version %}\
  14. # [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
  15. {% else %}\
  16. # [unreleased]
  17. {% endif %}\
  18. {% for group, commits in commits | group_by(attribute="group") %}
  19. {{ group | striptags | upper_first }}
  20. --------------------------------------------------------------------------------
  21. {% for commit in commits | sort(attribute="message")%}\
  22. {% if not commit.scope %}\
  23. - {{ commit.id | truncate(length=12, end="") }} {{ commit.message }}
  24. {% endif %}\
  25. {% endfor %}\
  26. {% for group, commits in commits | group_by(attribute="scope") %}\
  27. {% for commit in commits | sort(attribute="message") %}\
  28. - {{ commit.id | truncate(length=12, end="") }} {{commit.scope}}: {{ commit.message }}
  29. {% endfor %}\
  30. {% endfor %}
  31. {% endfor %}\n
  32. """
  33. # remove the leading and trailing whitespace from the template
  34. trim = true
  35. [git]
  36. # parse the commits based on https://www.conventionalcommits.org
  37. conventional_commits = true
  38. # filter out the commits that are not conventional
  39. filter_unconventional = true
  40. # process each line of a commit as an individual commit
  41. split_commits = false
  42. # regex for preprocessing the commit messages
  43. commit_preprocessors = [
  44. # { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/neovim/neovim/issues/${2}))"},
  45. ]
  46. # regex for parsing and grouping commits
  47. commit_parsers = [
  48. { message = "!:", group = "<!-- 0 -->BREAKING"},
  49. { message = "^feat", group = "<!-- 1 -->FEATURES"},
  50. { message = "^fix", group = "<!-- 2 -->FIXES"},
  51. { message = "^perf", group = "<!-- 3 -->PERFORMANCE"},
  52. { message = "^build", group = "<!-- 4 -->BUILD"},
  53. { message = "^vim-patch", group = "<!-- 5 -->VIM PATCHES"},
  54. { message = "^refactor", group = "<!-- 6 -->REFACTOR" },
  55. { message = "^ci", group = "<!-- 8 -->CI" },
  56. { message = "^test", group = "<!-- 9 -->TESTING" },
  57. { message = "^docs", group = "<!-- 99 -->DOCUMENTATION" },
  58. { message = "^revert", group = "<!-- 999 -->REVERTED CHANGES" },
  59. { message = ".*", group = "<!-- 9999 -->OTHER"},
  60. ]
  61. # filter out the commits that are not matched by commit parsers
  62. filter_commits = true
  63. # glob pattern for matching git tags
  64. tag_pattern = "v[0-9]*"
  65. # regex for skipping tags
  66. skip_tags = "v0.1.0-beta.1"
  67. # regex for ignoring tags
  68. ignore_tags = ""
  69. # sort the tags chronologically
  70. date_order = false
  71. # sort the commits inside sections by oldest/newest order
  72. sort_commits = "oldest"