cz-changeup 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
cz_changeup/__init__.py
ADDED
|
File without changes
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
__all__ = ["ChangeupCz"]
|
|
2
|
+
|
|
3
|
+
from commitizen import config, git
|
|
4
|
+
from commitizen.cz.conventional_commits import ConventionalCommitsCz
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ChangeupCz(ConventionalCommitsCz):
|
|
8
|
+
conf = config.read_cfg()
|
|
9
|
+
|
|
10
|
+
repo_base_url: str = conf.settings.get("changeup_repo_base_url", "").strip(" /")
|
|
11
|
+
show_body: bool = conf.settings.get("changeup_show_body", True)
|
|
12
|
+
body_indent: int = conf.settings.get("changeup_body_indent", 2)
|
|
13
|
+
|
|
14
|
+
def changelog_message_builder_hook(
|
|
15
|
+
self, parsed_message: dict, commit: git.GitCommit
|
|
16
|
+
) -> dict | list | None:
|
|
17
|
+
msg = str(parsed_message["message"])
|
|
18
|
+
|
|
19
|
+
if self.repo_base_url:
|
|
20
|
+
msg = (
|
|
21
|
+
msg + f" ([{commit.rev[:7]}]({self.repo_base_url}/commit/{commit.rev}))"
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
if self.show_body and commit.body:
|
|
25
|
+
msg += f"\n\n{' ' * self.body_indent}"
|
|
26
|
+
body = commit.body.replace("\n", "\n" + (" " * self.body_indent))
|
|
27
|
+
msg += f"{body}"
|
|
28
|
+
|
|
29
|
+
parsed_message["message"] = msg
|
|
30
|
+
return parsed_message
|
|
31
|
+
|
|
32
|
+
@property
|
|
33
|
+
def template_extras(self) -> dict[str, str]:
|
|
34
|
+
return {"repo_base_url": self.repo_base_url}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: cz-changeup
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Commitizen plugin for better changelog generation
|
|
5
|
+
Project-URL: Changelog, https://github.com/kmnhan/cz-changeup#changelog
|
|
6
|
+
Project-URL: Documentation, https://github.com/kmnhan/cz-changeup#readme
|
|
7
|
+
Project-URL: Issues, https://github.com/kmnhan/cz-changeup/issues
|
|
8
|
+
Project-URL: Source, https://github.com/kmnhan/cz-changeup
|
|
9
|
+
Author-email: Kimoon Han <khan@kaist.ac.kr>
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
Keywords: changelog,commitizen
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Natural Language :: English
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Requires-Python: >=3.8
|
|
24
|
+
Requires-Dist: commitizen>=3.0.0
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
# cz-changeup
|
|
28
|
+
|
|
29
|
+
This plugin is a version of
|
|
30
|
+
[Commitizen](https://commitizen-tools.github.io/commitizen/)'s default conventional
|
|
31
|
+
style with a more informative changelog format.
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pip install cz-changeup
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Configuration
|
|
40
|
+
|
|
41
|
+
Add to your `pyproject.toml`:
|
|
42
|
+
|
|
43
|
+
```toml
|
|
44
|
+
[tool.commitizen]
|
|
45
|
+
name = "cz_changeup"
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The behavior of the plugin can be customized by providing the following options under `tool.commitizen`:
|
|
49
|
+
|
|
50
|
+
| Option | Description | Default | Example |
|
|
51
|
+
| ------------------------ | ----------------------------------------------------------------------------------------------------- | ------- | ------------------------------ |
|
|
52
|
+
| `changeup_repo_base_url` | The base URL for the repository. If given, adds a link to the commit for each entry in the changelog. | `""` | `"https://github.com/my/repo"` |
|
|
53
|
+
| `changeup_show_body` | Whether to include the commit body in the changelog. | `true` | |
|
|
54
|
+
| `changeup_body_indent` | The number of spaces to indent the commit body if `show_body` is set to `true`. | `2` | |
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
cz_changeup/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
cz_changeup/cz_changeup.py,sha256=0y6bg3nVa-SIb_PxTO3T4o4qFe39rhJtFZsl29E_-2Q,1142
|
|
3
|
+
cz_changeup-0.1.0.dist-info/METADATA,sha256=KpqHoJqAdjY4SwwC91BQDLmI0jcay4QfQLjR1OHNCwM,2422
|
|
4
|
+
cz_changeup-0.1.0.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
5
|
+
cz_changeup-0.1.0.dist-info/entry_points.txt,sha256=FYnn-nUbKR4UAvVsRtRRg-k5Ovju68aee4DUE-9uKrM,69
|
|
6
|
+
cz_changeup-0.1.0.dist-info/RECORD,,
|