Skip to content

Commit 2eebbb1

Browse files
authored
Merge pull request #6 from wasabeef/test-improve-coverage
refactor: implement UserInterface abstraction layer for testability
2 parents fe74339 + 83a5563 commit 2eebbb1

34 files changed

+7587
-2393
lines changed

.github/cliff.toml

Lines changed: 79 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,100 @@
1-
# git-cliff configuration file
1+
# git-cliff ~ configuration file
22
# https://git-cliff.org/docs/configuration
33

44
[changelog]
5-
# changelog header
5+
# A Tera template to be rendered as the changelog's header.
6+
# See https://keats.github.io/tera/docs/#introduction
67
header = """
7-
# Changelog\n
8-
All notable changes to this project will be documented in this file.\n
8+
# Changelog
9+
10+
All notable changes to this project will be documented in this file.
11+
12+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
13+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
14+
915
"""
10-
# template for the changelog body
16+
# A Tera template to be rendered for each release in the changelog.
17+
# See https://keats.github.io/tera/docs/#introduction
1118
body = """
12-
{% if version %}\
19+
{% if version -%}
1320
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
14-
{% else %}\
15-
## [unreleased]
16-
{% endif %}\
21+
{% else -%}
22+
## [Unreleased]
23+
{% endif -%}
1724
{% for group, commits in commits | group_by(attribute="group") %}
18-
### {{ group | upper_first }}
19-
{% for commit in commits %}
20-
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}](https://github.com/wasabeef/git-workers/commit/{{ commit.id }}))
21-
{%- endfor %}
25+
{% if group == "Added" %}
26+
### Added
27+
{% elif group == "Changed" %}
28+
### Changed
29+
{% elif group == "Deprecated" %}
30+
### Deprecated
31+
{% elif group == "Removed" %}
32+
### Removed
33+
{% elif group == "Fixed" %}
34+
### Fixed
35+
{% elif group == "Security" %}
36+
### Security
37+
{% else %}
38+
### {{ group | upper_first }}
39+
{% endif %}
40+
{% for commit in commits -%}
41+
- {{ commit.message | split(pat="\n") | first | trim }}
42+
{% endfor %}
2243
{% endfor %}\n
2344
"""
24-
# template for the changelog footer
45+
# A Tera template to be rendered as the changelog's footer.
46+
# See https://keats.github.io/tera/docs/#introduction
2547
footer = """
48+
{% for release in releases -%}
49+
{% if release.version -%}
50+
{% if release.previous.version -%}
51+
[{{ release.version | trim_start_matches(pat="v") }}]: \
52+
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}\
53+
/compare/{{ release.previous.version }}..{{ release.version }}
54+
{% endif -%}
55+
{% else -%}
56+
[unreleased]: https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}\
57+
/compare/{{ release.previous.version }}..HEAD
58+
{% endif -%}
59+
{% endfor %}
2660
<!-- generated by git-cliff -->
2761
"""
28-
# remove the leading and trailing whitespace from the templates
62+
# Remove leading and trailing whitespaces from the changelog's body.
2963
trim = true
3064

3165
[git]
32-
# parse the commits based on https://www.conventionalcommits.org
66+
# Parse commits according to the conventional commits specification.
67+
# See https://www.conventionalcommits.org
3368
conventional_commits = true
34-
# filter out the commits that are not conventional
35-
filter_unconventional = true
36-
# process each line of a commit as an individual commit
37-
split_commits = false
38-
# regex for preprocessing the commit messages
39-
commit_preprocessors = [
40-
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/wasabeef/git-workers/issues/${2}))" },
41-
]
42-
# regex for parsing and grouping commits
69+
# Exclude commits that do not match the conventional commits specification.
70+
filter_unconventional = false
71+
# An array of regex based parsers for extracting data from the commit message.
72+
# Assigns commits to groups.
73+
# Optionally sets the commit's scope and can decide to exclude commits from further processing.
4374
commit_parsers = [
44-
{ message = "^feat", group = "Features" },
45-
{ message = "^fix", group = "Bug Fixes" },
46-
{ message = "^doc", group = "Documentation" },
47-
{ message = "^perf", group = "Performance" },
48-
{ message = "^refactor", group = "Refactor" },
49-
{ message = "^style", group = "Styling" },
50-
{ message = "^test", group = "Testing" },
51-
{ message = "^chore\\(release\\): prepare for", skip = true },
52-
{ message = "^chore\\(deps\\)", skip = true },
53-
{ message = "^chore\\(pr\\)", skip = true },
54-
{ message = "^chore\\(pull\\)", skip = true },
55-
{ message = "^chore|ci", group = "Miscellaneous Tasks" },
56-
{ body = ".*security", group = "Security" },
57-
{ message = "^revert", group = "Revert" },
75+
{ message = "^feat", group = "Added" },
76+
{ message = "^add", group = "Added" },
77+
{ message = "^support", group = "Added" },
78+
{ message = "^fix", group = "Fixed" },
79+
{ message = "^perf", group = "Fixed" },
80+
{ message = "^refactor", group = "Changed" },
81+
{ message = "^style", group = "Changed" },
82+
{ message = "^test", group = "Changed" },
83+
{ message = "^chore", group = "Changed" },
84+
{ message = "^docs", group = "Changed" },
85+
{ message = "^ci", group = "Changed" },
86+
{ message = "^build", group = "Changed" },
87+
{ message = "^remove", group = "Removed" },
88+
{ message = "^delete", group = "Removed" },
89+
{ message = ".*deprecated", group = "Deprecated" },
90+
{ message = ".*security", group = "Security" },
91+
{ message = "^.*", group = "Changed" },
5892
]
59-
# protect against committing breaking changes
60-
protect_breaking_commits = false
61-
# filter out the commits that are not matched by commit parsers
93+
# Prevent commits that are breaking from being excluded by commit parsers.
6294
filter_commits = false
63-
# sort the tags topologically
95+
# Order releases topologically instead of chronologically.
6496
topo_order = false
65-
# sort the commits inside sections by oldest/newest order
66-
sort_commits = "oldest"
97+
# Order of commits in each group/release within the changelog.
98+
# Allowed values: newest, oldest
99+
sort_commits = "oldest"
100+

0 commit comments

Comments
 (0)