Skip to main content

cz_legacy

Custom Commitizen parser for user-specified legacy change types. The parser utilizes the cz_conventional_commits pattern and extends with the tag mapping specified in the configuration file

While old change types will appear in the Changelog, the user will be prevented from using them in new commits. This is the reverse of the revert/chore logic from commitizen that allows use of those commit types, but won't display them in the changelog

Alternatives

This customization only works when old commits use the <change_type>: <message> format that can be parsed by commitizen. If that doesn't fit your use case, you may want to try out incremental which (I think) doesn't prepends to an existing CHANGELOG

Usage

Install

Install the package from PyPi: pip install cz_legacy or from git: pip install git+https://github.com/KyleKing/cz_legacy.git@main

Configuration

At minimum, you must have the name = "cz_legacy" and [tool.commitizen.cz_legacy_map] in your configuration file. The below example is for TOML, you can also utilize a YAML or JSON file.

Below is an example of the three change legacy types Chg, Fix, and New, but the user can choose any tag names and associated mapping for the Changelog

[tool.commitizen]
name = "cz_legacy"
# Other tool.commitizen configuration options

[tool.commitizen.cz_legacy_map]
Chg = "Change (old)"
Fix = "Fix (old)"
New = "New (old)"

Pre-Commit

To use in pre-commit, add this to your pre-commit-config.yml

repos:
  - repo: https://github.com/commitizen-tools/commitizen
    rev: v2.11.1
    hooks:
      - id: commitizen
        additional_dependencies: ["cz_legacy"]
        stages: [commit-msg]

Developer Information

See ./CONTRIBUTING.md

Issues

If you have any feature requests, run into any bugs, or have questions, feel free to start a discussion or open an issue on Github at https://github.com/kyleking/cz_legacy.

Background

I couldn't find a good way of adding a few legacy change types from an old commit style to commitizen so I built a package to extend the ConventionalCommitsCz to provide custom logic. For reference, these are the default settings

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cz_legacy-0.1.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cz_legacy-0.1.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file cz_legacy-0.1.0.tar.gz.

File metadata

  • Download URL: cz_legacy-0.1.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.8.3 Darwin/19.6.0

File hashes

Hashes for cz_legacy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0c3381877beb752b0ec7b343de2d53beb913932700f32563e35cdfdac59a3b7d
MD5 8d2841fac3cbe409209e68f880cb4f74
BLAKE2b-256 88cd999c4053235fb86f3938a3baa1f2ca78cb91079c490931bcf81679aa24d7

See more details on using hashes here.

File details

Details for the file cz_legacy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cz_legacy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.8.3 Darwin/19.6.0

File hashes

Hashes for cz_legacy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2b17e2113afd4a5ff8573118800b2505bc1042b0467a821668ff9cd1138d3d87
MD5 a6a01cdefabb1199dad6ddc476c0ca6f
BLAKE2b-256 87dbe938fd7f450db8330065f57babd747dd02b2f8da2ae6a75af28212b8347f

See more details on using hashes here.

Supported by

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