Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: setup git-cliff #12

Merged
merged 1 commit into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions cliff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[changelog]

header = """
# Changelog\n
All notable changes to this project will be documented in this file.\n
"""

body = """
{% if version %}\
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}\
## [unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | upper_first }}
{% for commit in commits %}
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\
{% endfor %}
{% endfor %}\n
"""

# Trim leading and trailing whitespace from changelog
trim = true

[git]

# Parse commits based on the conventional commits specification
conventional_commits = true

# Filter out commits that do not follow the conventional commits specification
filter_unconventional = true

# Filter out the commits that are not matched by commit parsers
filter_commits = true

# Commit parsers to use for parsing commits
commit_parsers = [
{ message = "^feat", group = "Features" },
{ message = "^fix", group = "Bug Fixes" },
{ message = "^doc", group = "Documentation"},
]

# Regex for matching git tags
tag_pattern = "v[0-9].*"
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@
"check:apply": "biome check . --apply-unsafe",
"pack:dev": "pnpm run compile && pnpm run package && pnpm run install-extension",
"tsc": "tsc",
"prepare": "lefthook install"
"prepare": "lefthook install",
"changelog": "git-cliff --unreleased 0544a0e103df4308c92b302ac3b22a1e3c26a64d.."
},
"devDependencies": {
"@biomejs/biome": "^1.3.3",
Expand All @@ -125,6 +126,7 @@
"@types/vscode": "^1.80.0",
"@vscode/vsce": "^2.22.0",
"esbuild": "^0.19.2",
"git-cliff": "^1.4.0",
"lefthook": "^1.5.2",
"typescript": "^5.1.6"
},
Expand Down
63 changes: 63 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.