Skip to content

Commit b1b6a71

Browse files
committed
ci: realigned CI and docs
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
1 parent 298ae86 commit b1b6a71

File tree

17 files changed

+944
-183
lines changed

17 files changed

+944
-183
lines changed

.cliff.toml

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
# git-cliff ~ configuration file
2+
# https://git-cliff.org/docs/configuration
3+
4+
[changelog]
5+
header = """
6+
"""
7+
8+
footer = """
9+
10+
-----
11+
12+
**[{{ remote.github.repo }}]({{ self::remote_url() }}) license terms**
13+
14+
[![License][license-badge]][license-url]
15+
16+
[license-badge]: http://img.shields.io/badge/license-Apache%20v2-orange.svg
17+
[license-url]: {{ self::remote_url() }}/?tab=Apache-2.0-1-ov-file#readme
18+
19+
{%- macro remote_url() -%}
20+
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
21+
{%- endmacro -%}
22+
"""
23+
24+
body = """
25+
{%- if version %}
26+
## [{{ version | trim_start_matches(pat="v") }}]({{ self::remote_url() }}/tree/{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
27+
{%- else %}
28+
## [unreleased]
29+
{%- endif %}
30+
{%- if message %}
31+
{%- raw %}\n{% endraw %}
32+
{{ message }}
33+
{%- raw %}\n{% endraw %}
34+
{%- endif %}
35+
{%- if version %}
36+
{%- if previous.version %}
37+
38+
**Full Changelog**: <{{ self::remote_url() }}/compare/{{ previous.version }}...{{ version }}>
39+
{%- endif %}
40+
{%- else %}
41+
{%- raw %}\n{% endraw %}
42+
{%- endif %}
43+
44+
{%- if statistics %}{% if statistics.commit_count %}
45+
{%- raw %}\n{% endraw %}
46+
{{ statistics.commit_count }} commits in this release.
47+
{%- raw %}\n{% endraw %}
48+
{%- endif %}{% endif %}
49+
-----
50+
51+
{%- for group, commits in commits | group_by(attribute="group") %}
52+
{%- raw %}\n{% endraw %}
53+
### {{ group | upper_first }}
54+
{%- raw %}\n{% endraw %}
55+
{%- for commit in commits %}
56+
{%- if commit.remote.pr_title %}
57+
{%- set commit_message = commit.remote.pr_title %}
58+
{%- else %}
59+
{%- set commit_message = commit.message %}
60+
{%- endif %}
61+
* {{ commit_message | split(pat="\n") | first | trim }}
62+
{%- if commit.remote.username %}
63+
{%- raw %} {% endraw %}by [@{{ commit.remote.username }}](https://github.com/{{ commit.remote.username }})
64+
{%- endif %}
65+
{%- if commit.remote.pr_number %}
66+
{%- raw %} {% endraw %}in [#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.remote.pr_number }})
67+
{%- endif %}
68+
{%- raw %} {% endraw %}[...]({{ self::remote_url() }}/commit/{{ commit.id }})
69+
{%- endfor %}
70+
{%- endfor %}
71+
72+
{%- if github %}
73+
{%- raw %}\n{% endraw -%}
74+
{%- set all_contributors = github.contributors | length %}
75+
{%- if github.contributors | filter(attribute="username", value="dependabot[bot]") | length < all_contributors %}
76+
-----
77+
78+
### People who contributed to this release
79+
{% endif %}
80+
{%- for contributor in github.contributors | filter(attribute="username") | sort(attribute="username") %}
81+
{%- if contributor.username != "dependabot[bot]" and contributor.username != "github-actions[bot]" %}
82+
* [@{{ contributor.username }}](https://github.com/{{ contributor.username }})
83+
{%- endif %}
84+
{%- endfor %}
85+
86+
{% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
87+
-----
88+
{%- raw %}\n{% endraw %}
89+
90+
### New Contributors
91+
{%- endif %}
92+
93+
{%- for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
94+
{%- if contributor.username != "dependabot[bot]" and contributor.username != "github-actions[bot]" %}
95+
* @{{ contributor.username }} made their first contribution
96+
{%- if contributor.pr_number %}
97+
in [#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \
98+
{%- endif %}
99+
{%- endif %}
100+
{%- endfor %}
101+
{%- endif %}
102+
103+
{%- raw %}\n{% endraw %}
104+
105+
{%- macro remote_url() -%}
106+
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
107+
{%- endmacro -%}
108+
"""
109+
# Remove leading and trailing whitespaces from the changelog's body.
110+
trim = true
111+
# Render body even when there are no releases to process.
112+
render_always = true
113+
# An array of regex based postprocessors to modify the changelog.
114+
postprocessors = [
115+
# Replace the placeholder <REPO> with a URL.
116+
#{ pattern = '<REPO>', replace = "https://github.com/orhun/git-cliff" },
117+
]
118+
# output file path
119+
# output = "test.md"
120+
121+
[git]
122+
# Parse commits according to the conventional commits specification.
123+
# See https://www.conventionalcommits.org
124+
conventional_commits = false
125+
# Exclude commits that do not match the conventional commits specification.
126+
filter_unconventional = false
127+
# Require all commits to be conventional.
128+
# Takes precedence over filter_unconventional.
129+
require_conventional = false
130+
# Split commits on newlines, treating each line as an individual commit.
131+
split_commits = false
132+
# An array of regex based parsers to modify commit messages prior to further processing.
133+
commit_preprocessors = [
134+
# Replace issue numbers with link templates to be updated in `changelog.postprocessors`.
135+
#{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"},
136+
# Check spelling of the commit message using https://github.com/crate-ci/typos.
137+
# If the spelling is incorrect, it will be fixed automatically.
138+
#{ pattern = '.*', replace_command = 'typos --write-changes -' }
139+
]
140+
# Prevent commits that are breaking from being excluded by commit parsers.
141+
protect_breaking_commits = false
142+
# An array of regex based parsers for extracting data from the commit message.
143+
# Assigns commits to groups.
144+
# Optionally sets the commit's scope and can decide to exclude commits from further processing.
145+
commit_parsers = [
146+
{ message = "^[Cc]hore\\([Rr]elease\\): prepare for", skip = true },
147+
{ message = "(^[Mm]erge)|([Mm]erge conflict)", skip = true },
148+
{ field = "author.name", pattern = "dependabot*", group = "<!-- 0A -->Updates" },
149+
{ message = "([Ss]ecurity)|([Vv]uln)", group = "<!-- 08 -->Security" },
150+
{ body = "(.*[Ss]ecurity)|([Vv]uln)", group = "<!-- 08 -->Security" },
151+
{ message = "([Cc]hore\\(lint\\))|(style)|(lint)|(codeql)|(golangci)", group = "<!-- 05 -->Code quality" },
152+
{ message = "(^[Dd]oc)|((?i)readme)|(badge)|(typo)|(documentation)", group = "<!-- 03 -->Documentation" },
153+
{ message = "(^[Ff]eat)|(^[Ee]nhancement)", group = "<!-- 00 -->Implemented enhancements" },
154+
{ message = "(^ci)|(\\(ci\\))|(fixup\\s+ci)|(fix\\s+ci)|(license)|(example)", group = "<!-- 07 -->Miscellaneous tasks" },
155+
{ message = "^test", group = "<!-- 06 -->Testing" },
156+
{ message = "(^fix)|(panic)", group = "<!-- 01 -->Fixed bugs" },
157+
{ message = "(^refact)|(rework)", group = "<!-- 02 -->Refactor" },
158+
{ message = "(^[Pp]erf)|(performance)", group = "<!-- 04 -->Performance" },
159+
{ message = "(^[Cc]hore)", group = "<!-- 07 -->Miscellaneous tasks" },
160+
{ message = "^[Rr]evert", group = "<!-- 09 -->Reverted changes" },
161+
{ message = "(upgrade.*?go)|(go\\s+version)", group = "<!-- 0A -->Updates" },
162+
{ message = ".*", group = "<!-- 0B -->Other" },
163+
]
164+
# Exclude commits that are not matched by any commit parser.
165+
filter_commits = false
166+
# An array of link parsers for extracting external references, and turning them into URLs, using regex.
167+
link_parsers = []
168+
# Include only the tags that belong to the current branch.
169+
use_branch_tags = false
170+
# Order releases topologically instead of chronologically.
171+
topo_order = false
172+
# Order releases topologically instead of chronologically.
173+
topo_order_commits = true
174+
# Order of commits in each group/release within the changelog.
175+
# Allowed values: newest, oldest
176+
sort_commits = "newest"
177+
# Process submodules commits
178+
recurse_submodules = false
179+
180+
#[remote.github]
181+
#owner = "go-openapi"

.editorconfig

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# top-most EditorConfig file
2+
root = true
3+
4+
# Unix-style newlines with a newline ending every file
5+
[*]
6+
end_of_line = lf
7+
insert_final_newline = true
8+
indent_style = space
9+
indent_size = 2
10+
trim_trailing_whitespace = true
11+
12+
# Set default charset
13+
[*.{js,py,go,scala,rb,java,html,css,less,sass,md}]
14+
charset = utf-8
15+
16+
# Tab indentation (no size specified)
17+
[*.go]
18+
indent_style = tab
19+
20+
[*.md]
21+
trim_trailing_whitespace = false
22+
23+
# Matches the exact files either package.json or .travis.yml
24+
[{package.json,.travis.yml}]
25+
indent_style = space
26+
indent_size = 2

0 commit comments

Comments
 (0)