cliff.toml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. [changelog]
  2. body = """
  3. {% for group, commits in commits | group_by(attribute="group") %}
  4. ### {{ group | striptags | trim | upper_first }}
  5. {% for commit in commits
  6. | filter(attribute="scope")
  7. | sort(attribute="scope") %}
  8. - **({{commit.scope}})**{% if commit.breaking %} [**breaking**]{% endif %} \
  9. {{ commit.message }} by [@{{ commit.author.name }}](https://github.com/{{ commit.author.name }}) in [{{ commit.id | truncate(length=7, end="") }}]($REPO/commit/{{ commit.id }})
  10. {%- endfor -%}
  11. {% raw %}\n{% endraw %}\
  12. {%- for commit in commits %}
  13. {%- if commit.scope -%}
  14. {% else -%}
  15. - {% if commit.breaking %} [**breaking**]{% endif %}\
  16. {{ commit.message }} by [@{{ commit.author.name }}](https://github.com/{{ commit.author.name }}) in [{{ commit.id | truncate(length=7, end="") }}]($REPO/commit/{{ commit.id }})
  17. {% endif -%}
  18. {% endfor -%}
  19. {% endfor %}
  20. {% if github.contributors | length > 0 %}
  21. ### 🎉 Contributors
  22. {% for contributor in github.contributors %}
  23. - [@{{ contributor.username }}](https://github.com/{{ contributor.username }})
  24. {%- endfor -%}
  25. {% endif %}
  26. {% if version %}
  27. {% if previous.version %}\
  28. **Full Changelog**: [{{ version | trim_start_matches(pat="v") }}]($REPO/compare/{{ previous.version }}..{{ version }})
  29. {% else %}\
  30. **Full Changelog**: [{{ version | trim_start_matches(pat="v") }}]
  31. {% endif %}\
  32. {% else %}\
  33. ## [unreleased]
  34. {% endif %}
  35. """
  36. footer = """
  37. """
  38. # Remove leading and trailing whitespaces from the changelog's body.
  39. trim = true
  40. postprocessors = [
  41. # Replace the placeholder `<REPO>` with a URL.
  42. { pattern = '\$REPO', replace = "https://github.com/RapidAI/RapidOCR" }, # replace repository URL
  43. # 去掉每行末尾的无效空格
  44. { pattern = "(?m)[ \t]+$", replace = "" },
  45. # 将连续多个空行压缩为最多一个空行
  46. { pattern = "\n{3,}", replace = "\n\n" },
  47. ]
  48. [git]
  49. # Parse commits according to the conventional commits specification.
  50. # See https://www.conventionalcommits.org
  51. conventional_commits = true
  52. # Exclude commits that do not match the conventional commits specification.
  53. filter_unconventional = false
  54. # Split commits on newlines, treating each line as an individual commit.
  55. split_commits = false
  56. # An array of regex based parsers to modify commit messages prior to further processing.
  57. commit_preprocessors = [
  58. # Replace issue numbers with link templates to be updated in `changelog.postprocessors`.
  59. #{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/orhun/git-cliff/issues/${2}))"},
  60. ]
  61. # An array of regex based parsers for extracting data from the commit message.
  62. # Assigns commits to groups.
  63. # Optionally sets the commit's scope and can decide to exclude commits from further processing.
  64. commit_parsers = [
  65. { message = "^feat", group = "<!-- 0 -->🚀 Features" },
  66. { message = "^fix", group = "<!-- 1 -->🐛 Bug Fixes" },
  67. { message = "^doc", group = "<!-- 3 -->📚 Documentation" },
  68. { message = "^perf", group = "<!-- 4 -->⚡ Performance" },
  69. { message = "^refactor", group = "<!-- 2 -->🚜 Refactor" },
  70. { message = "^style", group = "<!-- 5 -->🎨 Styling" },
  71. { message = "^test", group = "<!-- 6 -->🧪 Testing" },
  72. { message = "^chore\\(release\\): prepare for", skip = true },
  73. { message = "^chore\\(deps.*\\)", skip = true },
  74. { message = "^chore\\(pr\\)", skip = true },
  75. { message = "^chore\\(pull\\)", skip = true },
  76. { message = "^chore|^ci", group = "<!-- 7 -->⚙️ Miscellaneous Tasks" },
  77. { body = ".*security", group = "<!-- 8 -->🛡️ Security" },
  78. { message = "^revert", group = "<!-- 9 -->◀️ Revert" },
  79. { message = ".*", group = "<!-- 10 -->💼 Other" },
  80. ]
  81. # Exclude commits that are not matched by any commit parser.
  82. filter_commits = false
  83. # Order releases topologically instead of chronologically.
  84. topo_order = false
  85. # Order of commits in each group/release within the changelog.
  86. # Allowed values: newest, oldest
  87. sort_commits = "newest"