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

Uploaded Python 3

File details

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

File metadata

  • Download URL: cz_path-0.0.2.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.7 Linux/6.16.4-gentoo-limelight

File hashes

Hashes for cz_path-0.0.2.tar.gz
Algorithm Hash digest
SHA256 d23c8c197f99f4b6ae19febcdb759815e6093669318bc10424a1d3b89190599e
MD5 5c562866949d8e908ce0c2f7318229b9
BLAKE2b-256 313a16e07b72fbe3f92a713bbbbd5bcbb055c772fa8d43f3b0905dc10f40fb67

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cz_path-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.7 Linux/6.16.4-gentoo-limelight

File hashes

Hashes for cz_path-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 eeabf8514f546dddf5aeb3799c53e60352ee0ae822ba0fb973bfdf43efec82d7
MD5 67f13c0432efd9beef36fc47ee27fe35
BLAKE2b-256 89e06cba66489dfd1da75a1363c2c8ca6cc031046bd11f5829819376a63135b6

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