Skip to content

Commit ce7eae0

Browse files
committed
chore: Added pre-commit hooks and git-cliff
1 parent 11b08f2 commit ce7eae0

File tree

4 files changed

+95
-3
lines changed

4 files changed

+95
-3
lines changed

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,11 @@ repos:
3636
hooks:
3737
- id: hadolint-docker
3838
exclude: 'j2$'
39+
- repo: https://github.com/commitizen-tools/commitizen
40+
rev: v3.29.0 # automatically updated by Commitizen
41+
hooks:
42+
- id: commitizen
43+
- id: commitizen-branch
44+
stages:
45+
- post-commit
46+
- push

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
<!-- generated by git-cliff -->

cliff.toml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# git-cliff ~ default configuration file
2+
# https://git-cliff.org/docs/configuration
3+
#
4+
# Lines starting with "#" are comments.
5+
# Configuration options are organized into tables and keys.
6+
# See documentation for more information on available options.
7+
8+
[changelog]
9+
# template for the changelog header
10+
header = """
11+
# Changelog\n
12+
All notable changes to this project will be documented in this file.\n
13+
"""
14+
# template for the changelog body
15+
# https://keats.github.io/tera/docs/#introduction
16+
body = """
17+
{% if version %}\
18+
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
19+
{% else %}\
20+
## [unreleased]
21+
{% endif %}\
22+
{% for group, commits in commits | group_by(attribute="group") %}
23+
### {{ group | striptags | trim | upper_first }}
24+
{% for commit in commits %}
25+
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
26+
{% if commit.breaking %}[**breaking**] {% endif %}\
27+
{{ commit.message | upper_first }}\
28+
{% endfor %}
29+
{% endfor %}\n
30+
"""
31+
# template for the changelog footer
32+
footer = """
33+
<!-- generated by git-cliff -->
34+
"""
35+
# remove the leading and trailing s
36+
trim = true
37+
# postprocessors
38+
postprocessors = [
39+
# { pattern = '<REPO>', replace = "https://github.com/orhun/git-cliff" }, # replace repository URL
40+
]
41+
42+
[git]
43+
# parse the commits based on https://www.conventionalcommits.org
44+
conventional_commits = true
45+
# filter out the commits that are not conventional
46+
filter_unconventional = true
47+
# process each line of a commit as an individual commit
48+
split_commits = false
49+
# regex for preprocessing the commit messages
50+
commit_preprocessors = [
51+
# Replace issue numbers
52+
#{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"},
53+
# Check spelling of the commit with https://github.com/crate-ci/typos
54+
# If the spelling is incorrect, it will be automatically fixed.
55+
#{ pattern = '.*', replace_command = 'typos --write-changes -' },
56+
]
57+
# regex for parsing and grouping commits
58+
commit_parsers = [
59+
{ message = "^feat", group = "<!-- 0 -->🚀 Features" },
60+
{ message = "^fix", group = "<!-- 1 -->🐛 Bug Fixes" },
61+
{ message = "^doc", group = "<!-- 3 -->📚 Documentation" },
62+
{ message = "^perf", group = "<!-- 4 -->⚡ Performance" },
63+
{ message = "^refactor", group = "<!-- 2 -->🚜 Refactor" },
64+
{ message = "^style", group = "<!-- 5 -->🎨 Styling" },
65+
{ message = "^test", group = "<!-- 6 -->🧪 Testing" },
66+
{ message = "^chore\\(release\\): prepare for", skip = true },
67+
{ message = "^chore\\(deps.*\\)", skip = true },
68+
{ message = "^chore\\(pr\\)", skip = true },
69+
{ message = "^chore\\(pull\\)", skip = true },
70+
{ message = "^chore|^ci", group = "<!-- 7 -->⚙️ Miscellaneous Tasks" },
71+
{ body = ".*security", group = "<!-- 8 -->🛡️ Security" },
72+
{ message = "^revert", group = "<!-- 9 -->◀️ Revert" },
73+
]
74+
# filter out the commits that are not matched by commit parsers
75+
filter_commits = false
76+
# sort the tags topologically
77+
topo_order = false
78+
# sort the commits inside sections by oldest/newest order
79+
sort_commits = "oldest"

shard.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ shards:
1010

1111
base58:
1212
git: https://github.com/crystal-china/base58.cr.git
13-
version: 0.1.0+git.commit.4c521350c6358b6c04f64dc625e26a8f782a699d
13+
version: 0.1.0+git.commit.2b0564a975171f4507c33251e0c0ab7990459e23
1414

1515
cr-config:
1616
git: https://github.com/crystal-community/cr-config.git
1717
version: 5.1.0+git.commit.5eae3dfbf97da7dfa7c6e64a2a508069948518d3
1818

1919
crest:
2020
git: https://github.com/mamantoha/crest.git
21-
version: 1.3.13
21+
version: 1.4.1
2222

2323
crinja:
2424
git: https://github.com/straight-shoota/crinja.git
@@ -46,7 +46,7 @@ shards:
4646

4747
http_proxy:
4848
git: https://github.com/mamantoha/http_proxy.git
49-
version: 0.10.3
49+
version: 0.12.0
5050

5151
kemal:
5252
git: https://github.com/kemalcr/kemal.git

0 commit comments

Comments
 (0)