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.4.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.4-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cz_path-0.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 d40c1d571def8c03324776212bb274022b3ee42cbfe0a804d6a5bbaaae340414
MD5 cb3e7fa534104144034db1deb43d0bd0
BLAKE2b-256 5f0b3494b6d12bb25b381072908839ca6d298cf9be1e44f682313da9c1171694

See more details on using hashes here.

Provenance

The following attestation bundles were made for cz_path-0.0.4.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.4-py3-none-any.whl.

File metadata

  • Download URL: cz_path-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 5.5 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 804cead9f91c6983e05340b3a4661f8a3f6fea591d015455483492e7b90f7b5a
MD5 5ebf4f6ad91daedb10ca89c35a373a73
BLAKE2b-256 4961238e8c597bb28655d87fd207b021b266001db0c6e387fe9beff5f72337e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for cz_path-0.0.4-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