Skip to main content

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

cz_github_linear_conventional-1.4.1.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

cz_github_linear_conventional-1.4.1-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file cz_github_linear_conventional-1.4.1.tar.gz.

File metadata

  • Download URL: cz_github_linear_conventional-1.4.1.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for cz_github_linear_conventional-1.4.1.tar.gz
Algorithm Hash digest
SHA256 338e329e517ba3c5a1a5005504da5cb30bddc6135b6d42ade4f41260d653d620
MD5 0fa272d246c44373ff4e3549ad3d1eb9
BLAKE2b-256 92da70c2d6f69b4bd4f3ad23ace7f47a4afe2067b4f948dfa686758947f194ad

See more details on using hashes here.

File details

Details for the file cz_github_linear_conventional-1.4.1-py3-none-any.whl.

File metadata

  • Download URL: cz_github_linear_conventional-1.4.1-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for cz_github_linear_conventional-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e1087568d4b02bedf1bb7c7c51ddb9d00b6deb67e98f6f9594d9b2d24493acf7
MD5 7b6b1cdc23f7a1e0152726577308fe3b
BLAKE2b-256 a740b9cdb2d7371173f93a603fb6f29cbf19f061a60567e0d3e2898deb9e6958

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page