aboutsummaryrefslogtreecommitdiff
path: root/pyproject.toml
diff options
context:
space:
mode:
authorGergely Nagy <gergely.nagy@arm.com>2023-12-13 19:07:28 +0000
committerGergely Nagy <gergely.nagy@arm.com>2024-01-23 12:53:01 +0000
commit732d8ef0bba9d23c731611dbed25e2e24a8a30d2 (patch)
treef369a01301e8a4634e232a9b0c21854e22f63b69 /pyproject.toml
parent54eec806272b7574a0757c77a913a369a9ecdc70 (diff)
downloadmlia-732d8ef0bba9d23c731611dbed25e2e24a8a30d2.tar.gz
build: Integrate Commitizen to check commit messages and generate changelog
The commit messages are checked against the Conventional Commits (https://www.conventionalcommits.org) specification, along with minor customizations (eg, capitalized header, some irrelevant commit types removed Checking messages is integrated into `tox -e lint`. Changelog generation is integrated into "tox -e changelog", which runs `cz changelog` command underneath and incrementally updates RELEASES.md. Change-Id: I86f21f6c78a166d3bb92450a027a2d7e71ce22cf Signed-off-by: Gergely Nagy <gergely.nagy@arm.com>
Diffstat (limited to 'pyproject.toml')
-rw-r--r--pyproject.toml22
1 files changed, 21 insertions, 1 deletions
diff --git a/pyproject.toml b/pyproject.toml
index 827ae30..0c4cc8c 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,4 +1,4 @@
-# SPDX-FileCopyrightText: Copyright 2022, Arm Limited and/or its affiliates.
+# SPDX-FileCopyrightText: Copyright 2022-2023, Arm Limited and/or its affiliates.
# SPDX-FileCopyrightText: Copyright (c) 2012-2022 Jukka Lehtosalo and contributors
# SPDX-FileCopyrightText: Copyright (c) 2015-2022 Dropbox, Inc.
# SPDX-License-Identifier: Apache-2.0 AND MIT
@@ -73,3 +73,23 @@ module = [
"requests"
]
ignore_missing_imports = true
+
+[tool.commitizen]
+# This simply signifies that we want to customize the commitizen configuration
+name = "cz_customize"
+# name = "cz_conventional_commits"
+tag_format = "$version"
+version_scheme = "semver"
+version_provider = "scm"
+update_changelog_on_bump = true
+
+[tool.commitizen.customize]
+# Schema pattern is used by `cz check`, and `tox -e lint` in turn. Builtin CC pattern:
+# (?s)(build|ci|docs|feat|fix|perf|refactor|style|test|chore|revert|bump)(\\(\\S+\\))?!?:( [^\\n\\r]+)((\\n\\n.*)|(\\s*))?$
+# We customize this slightly by removing types that don't seem relevant now:
+schema_pattern = "(?s)(build|ci|docs|feat|fix|perf|refactor|style|test)(\\(\\S+\\))?!?:( [A-Z][^\\n\\r]+)((\\n\\n.*)|(\\s*))?$"
+schema = "<type>(<scope>): <Subject-capitalized>\n<BLANK LINE>\n<body>\n<BLANK LINE>\n(BREAKING CHANGE: )<footer>"
+# Commit parser is used to render the commits for RELEASES.md
+commit_parser = "^((?P<change_type>feat|fix|refactor|perf|BREAKING CHANGE)(?:\\((?P<scope>[^()\\r\\n]*)\\)|\\()?(?P<breaking>!)?|\\w+!):\\s(?P<message>.*)?"
+# Change type map to render the title for that category as per {tag:title}
+change_type_map = {'feat' = 'Feature changes', 'fix' = 'Bug fix', 'perf' = 'Performance improvements'}