Skip to main content

Commitizen plugin that prefixes commit messages with the common path or prefix of staged files.

Project description

cz-path

Python versions PyPI - Version GitHub tag (with filter) License GitHub commits since latest release (by SemVer including pre-releases) CodeQL QA Tests Coverage Status Documentation Status mypy pre-commit pydocstyle pytest Ruff Downloads Stargazers

@Tatsh Mastodon Follow

Commitizen plugin that prefixes commit messages with the common path or prefix of staged files.

Installation

Poetry

Example with dev group:

poetry add -G dev cz-path

Pip

pip install cz-path

Usage

Pass -n cz_path to cz or add it to your configuration file.

By default, src/ will be removed from any determined prefix. This can be customised by setting remove_path_prefixes to []. You also may want to add other locations such as a module name. Adding / is not required.

pyproject.toml

[tool.commitizen]
name = "cz_path"
remove_path_prefixes = ["src", "module_name"]

.cz.json

{
  "commitizen": {
    "name": "cz_path",
    "remove_path_prefixes": ["src", "module_name"]
  }
}

Scenarios

Staged files Path prefix String prefix
src/a.c, src/b.c src src/
src/a1.c, src/a2.c src src/a
a.c, b.c (no option) (no option)

If no prefix is found amongst the staged files, only the choices project and empty will be given.

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_path-0.0.3.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

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

cz_path-0.0.3-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file cz_path-0.0.3.tar.gz.

File metadata

  • Download URL: cz_path-0.0.3.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cz_path-0.0.3.tar.gz
Algorithm Hash digest
SHA256 ac039de5512bdf8d04c7c0ca2dd7b9a86d403559116622c1938beadbc66c9777
MD5 6b96d564e2bbfc5aae7b6d27a1d23e80
BLAKE2b-256 be698b6cfaed6311c3d7e18514c5f60afe050dd362da7efbead31ea7d34096a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for cz_path-0.0.3.tar.gz:

Publisher: publish.yml on Tatsh/cz-path

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cz_path-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: cz_path-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cz_path-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c62ef9e444dd976505022b2e709192c1ca90dc5bdad808b90d3aac02e60fd329
MD5 d1de4d3207b395c7c07689dce10f10e2
BLAKE2b-256 c2fd1955f661dce5d7924d032953cd1f0ebff02834631fdc19aadd7d6d4699cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for cz_path-0.0.3-py3-none-any.whl:

Publisher: publish.yml on Tatsh/cz-path

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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