Extend the commitizen tools to create conventional commits and README that link to Jira and Git repo.
Project description
cz-git-repo-jira-conventional
cz-git-repo-jira-conventional is a plugin for the commitizen tools, a toolset that helps you to create conventional commit messages. Since the structure of conventional commits messages is standardized they are machine readable and allow commitizen to automaticially calculate and tag semantic version numbers as well as create CHANGELOG.md files for your releases.
This plugin extends the commitizen tools by:
- require a Jira issue id in the commit message
- create links to Git commits in the CHANGELOG.md
- create links to Jira issues in the CHANGELOG.md
When you call commitizen commit
you will be required you to enter the scope of your commit as a Jira issue id (or multiple issue ids, prefixed or without prefix, see config below).
> cz commit
? Select the type of change you are committing fix: A bug fix. Correlates with PATCH in SemVer
? JIRA issue number (multiple "42, 123"). XX-
...
The changelog created by cz (cz bump --changelog
)will contain links to the commits in Github and the Jira issues.
## v1.0.0 (2021-08-06)
### Features
- **[XX-123](https://myproject.atlassian.net/browse/XX-123)**: create changelogs with links to issues and commits [a374b](https://github.com/wisnerjr/cz-git-repo-jira-conventional/commit/a374b93f39327964f5ab5290252b795647906008)
- **[XX-42](https://myproject.atlassian.net/browse/XX-42),[XX-13](https://myproject.atlassian.net/browse/XX-13)**: allow multiple issue to be referenced in the commit [07ab0](https://github.com/wisnerjr/cz-git-repo-jira-conventional/commit/07ab0e09de36712ab1db93fff0c821ecd80b5849)
Installation
Install with pip
python -m pip install cz-git-repo-jira-conventional
You need to use a cz config file that has the required additional values jira_base_url
and gi_repo
and may contain the optional value jira_prefix
if you are only using one Jira project (then the prefix for this project will be added automatically).
Example .cz.yaml
config for this repository
commitizen:
name: cz_git_repo_jira_conventional
tag_format: v$version
version: 1.0.0
jira_prefix: XX-
jira_base_url: https://myproject.atlassian.net
github_repo: https://github.com/wisnerjr/cz-git-repo-jira-conventional
pre-commit
Add this plugin to the dependencies of your commit message linting with pre-commit
.
Example .pre-commit-config.yaml
file.
repos:
- repo: https://github.com/commitizen-tools/commitizen
rev: v2.17.13
hooks:
- id: commitizen
stages: [commit-msg]
additional_dependencies: [cz-git-repo-jira-conventional]
Install the hook with
pre-commit install --hook-type commit-msg
License
Distributed under the MIT License. See LICENSE
for more information.
Acknowledgements
This plugin would not have been possible without the fantastic work from:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cz_git_repo_jira_conventional-2.0.1.tar.gz
.
File metadata
- Download URL: cz_git_repo_jira_conventional-2.0.1.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 410e52403a304891704d90d68875c81c53f822fcc0d894339251c13951b9441c |
|
MD5 | b448bf4fa046bb9b9f3b01a2886bd563 |
|
BLAKE2b-256 | 0a8fb22b45e90aa68e14397524709c23f5cde05902f9e0bbdb426aaead9e7b34 |
File details
Details for the file cz_git_repo_jira_conventional-2.0.1-py3-none-any.whl
.
File metadata
- Download URL: cz_git_repo_jira_conventional-2.0.1-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4cb845b0842ada7b0f2149a3b2513b45c2186175f4c53b8dbd2b3706f4d1b491 |
|
MD5 | ad98a1b047933c6820d15ec3607af649 |
|
BLAKE2b-256 | f7f100674da6d29d0e9356eb3e94c76c474b0eeec412c955cb92d9ede1294426 |