Extend the commitizen tools to create conventional commits and README that link to Linear.app and GitHub.
Project description
cz-github-linear-conventional
cz-github-linear-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 Linear issue id in the commit message
- create links to GitHub commits in the CHANGELOG.md
- create links to Linear issues in the CHANGELOG.md
When you call commitizen commit
the scope is assumed from the current active branch. The Linear issue id should be available in the branch name for this. (See example below for automatically parsed issue id)
> cz commit
? Select the type of change you are committing fix: A bug fix. Correlates with PATCH in SemVer
? Linear issue number: cae-123
...
The changelog created by cz (cz bump --changelog
)will contain links to the commits in Github and the Linear issues.
## 1.1.0 (2022-02-15)
### Feat
- **[cae-62](https://linear.app/caesari/issue/cae-62)**: adding support for linear issue ids because it is nice [8adc3](https://github.com/ThimDeveloper/cz-github-linear-conventional/commit/8adc39bc0cb35fff07f5c9c4b906b1b3eefd3f56)
Installation
Install with pip
python -m pip install cz-github-linear-conventional
You need to use a cz config file that has the required additional values linear_base_url
and github_repo
. The scope or prefix for your linear issues will automatically be parsed from the current active branch and added to the commit message. This allows for automatic linking by the linear.app bot if that is set up for your linear project.
Example .cz.yaml
config for this repository
commitizen:
name: cz_github_linear_conventional
tag_format: $version
version: 1.0.0
linear_base_url: https://linear.app/caesari
github_repo: ThimDeveloper/cz-github-linear-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-github-linear-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
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
Hashes for cz_github_linear_conventional-1.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b607fdc6bb5935825a6aae4e95ff441a27e3577e96aad65ed5469e6b5c2642c |
|
MD5 | 6e8043c218059285107409aba27225c1 |
|
BLAKE2b-256 | fe51641a2e31cb5904f581714c11bb15dcec485828fdc9206f984386bcdd5769 |
Hashes for cz_github_linear_conventional-1.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1dfc9b6822b86a1c428e508d618bd030f9f17cb3b8ad3741665466a65b79f0b5 |
|
MD5 | 86688b196b5639e8b3d0a1d680bdcf1d |
|
BLAKE2b-256 | 728cd34f4fd46bfbeddf52159eb79847b7a1955db5b306683b113176ea18703e |