cz-path


Namecz-path JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://tatsh.github.io/cz-path/
SummaryCommitizen plugin that prefixes commit messages with the common path or prefix of staged files.
upload_time2025-07-14 02:01:20
maintainerNone
docs_urlNone
authorAndrew Udvare
requires_python<3.14,>=3.10
licenseMIT
keywords commitizen commit messages git version control
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # cz-path

[![Python versions](https://img.shields.io/pypi/pyversions/cz-path.svg?color=blue&logo=python&logoColor=white)](https://www.python.org/)
[![PyPI - Version](https://img.shields.io/pypi/v/cz-path)](https://pypi.org/project/cz-path/)
[![GitHub tag (with filter)](https://img.shields.io/github/v/tag/Tatsh/cz-path)](https://github.com/Tatsh/cz-path/tags)
[![License](https://img.shields.io/github/license/Tatsh/cz-path)](https://github.com/Tatsh/cz-path/blob/master/LICENSE.txt)
[![GitHub commits since latest release (by SemVer including pre-releases)](https://img.shields.io/github/commits-since/Tatsh/cz-path/v0.0.1/master)](https://github.com/Tatsh/cz-path/compare/v0.0.1...master)
[![CodeQL](https://github.com/Tatsh/cz-path/actions/workflows/codeql.yml/badge.svg)](https://github.com/Tatsh/cz-path/actions/workflows/codeql.yml)
[![QA](https://github.com/Tatsh/cz-path/actions/workflows/qa.yml/badge.svg)](https://github.com/Tatsh/cz-path/actions/workflows/qa.yml)
[![Tests](https://github.com/Tatsh/cz-path/actions/workflows/tests.yml/badge.svg)](https://github.com/Tatsh/cz-path/actions/workflows/tests.yml)
[![Coverage Status](https://coveralls.io/repos/github/Tatsh/cz-path/badge.svg?branch=master)](https://coveralls.io/github/Tatsh/cz-path?branch=master)
[![Documentation Status](https://readthedocs.org/projects/cz-path/badge/?version=latest)](https://cz-path.readthedocs.org/?badge=latest)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Downloads](https://static.pepy.tech/badge/cz-path/month)](https://pepy.tech/project/cz-path)
[![Stargazers](https://img.shields.io/github/stars/Tatsh/cz-path?logo=github&style=flat)](https://github.com/Tatsh/cz-path/stargazers)

[![@Tatsh](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fpublic.api.bsky.app%2Fxrpc%2Fapp.bsky.actor.getProfile%2F%3Factor%3Ddid%3Aplc%3Auq42idtvuccnmtl57nsucz72%26query%3D%24.followersCount%26style%3Dsocial%26logo%3Dbluesky%26label%3DFollow%2520%40Tatsh&query=%24.followersCount&style=social&logo=bluesky&label=Follow%20%40Tatsh)](https://bsky.app/profile/Tatsh.bsky.social)
[![Mastodon Follow](https://img.shields.io/mastodon/follow/109370961877277568?domain=hostux.social&style=social)](https://hostux.social/@Tatsh)

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

## Installation

### Poetry

Example with `dev` group:

```shell
poetry add -G dev cz-path
```

### Pip

```shell
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`

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

### `.cz.json`

```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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://tatsh.github.io/cz-path/",
    "name": "cz-path",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.14,>=3.10",
    "maintainer_email": null,
    "keywords": "commitizen, commit messages, git, version control",
    "author": "Andrew Udvare",
    "author_email": "audvare@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/5f/7e/fe0e7e0d0f6a79b7a45dd8e321c1ba7989ec89e196f2bdf146ae7683c97e/cz_path-0.0.1.tar.gz",
    "platform": null,
    "description": "# cz-path\n\n[![Python versions](https://img.shields.io/pypi/pyversions/cz-path.svg?color=blue&logo=python&logoColor=white)](https://www.python.org/)\n[![PyPI - Version](https://img.shields.io/pypi/v/cz-path)](https://pypi.org/project/cz-path/)\n[![GitHub tag (with filter)](https://img.shields.io/github/v/tag/Tatsh/cz-path)](https://github.com/Tatsh/cz-path/tags)\n[![License](https://img.shields.io/github/license/Tatsh/cz-path)](https://github.com/Tatsh/cz-path/blob/master/LICENSE.txt)\n[![GitHub commits since latest release (by SemVer including pre-releases)](https://img.shields.io/github/commits-since/Tatsh/cz-path/v0.0.1/master)](https://github.com/Tatsh/cz-path/compare/v0.0.1...master)\n[![CodeQL](https://github.com/Tatsh/cz-path/actions/workflows/codeql.yml/badge.svg)](https://github.com/Tatsh/cz-path/actions/workflows/codeql.yml)\n[![QA](https://github.com/Tatsh/cz-path/actions/workflows/qa.yml/badge.svg)](https://github.com/Tatsh/cz-path/actions/workflows/qa.yml)\n[![Tests](https://github.com/Tatsh/cz-path/actions/workflows/tests.yml/badge.svg)](https://github.com/Tatsh/cz-path/actions/workflows/tests.yml)\n[![Coverage Status](https://coveralls.io/repos/github/Tatsh/cz-path/badge.svg?branch=master)](https://coveralls.io/github/Tatsh/cz-path?branch=master)\n[![Documentation Status](https://readthedocs.org/projects/cz-path/badge/?version=latest)](https://cz-path.readthedocs.org/?badge=latest)\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)\n[![mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![Downloads](https://static.pepy.tech/badge/cz-path/month)](https://pepy.tech/project/cz-path)\n[![Stargazers](https://img.shields.io/github/stars/Tatsh/cz-path?logo=github&style=flat)](https://github.com/Tatsh/cz-path/stargazers)\n\n[![@Tatsh](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fpublic.api.bsky.app%2Fxrpc%2Fapp.bsky.actor.getProfile%2F%3Factor%3Ddid%3Aplc%3Auq42idtvuccnmtl57nsucz72%26query%3D%24.followersCount%26style%3Dsocial%26logo%3Dbluesky%26label%3DFollow%2520%40Tatsh&query=%24.followersCount&style=social&logo=bluesky&label=Follow%20%40Tatsh)](https://bsky.app/profile/Tatsh.bsky.social)\n[![Mastodon Follow](https://img.shields.io/mastodon/follow/109370961877277568?domain=hostux.social&style=social)](https://hostux.social/@Tatsh)\n\nCommitizen plugin that prefixes commit messages with the common path or prefix of staged files.\n\n## Installation\n\n### Poetry\n\nExample with `dev` group:\n\n```shell\npoetry add -G dev cz-path\n```\n\n### Pip\n\n```shell\npip install cz-path\n```\n\n## Usage\n\nPass `-n cz_path` to `cz` or add it to your configuration file.\n\nBy default, `src/` will be removed from any determined prefix. This can be customised by setting\n`remove_path_prefixes` to `[]`. You also may want to add other locations such as a module name.\nAdding `/` is not required.\n\n### `pyproject.toml`\n\n```toml\n[tool.commitizen]\nname = \"cz_path\"\nremove_path_prefixes = [\"src\", \"module_name\"]\n```\n\n### `.cz.json`\n\n```json\n{\n  \"commitizen\": {\n    \"name\": \"cz_path\",\n    \"remove_path_prefixes\": [\"src\", \"module_name\"]\n  }\n}\n```\n\n### Scenarios\n\n| Staged files           | Path prefix | String prefix |\n| ---------------------- | ----------- | ------------- |\n| `src/a.c`, `src/b.c`   | `src`       | `src/`        |\n| `src/a1.c`, `src/a2.c` | `src`       | `src/a`       |\n| `a.c`, `b.c`           | (no option) | (no option)   |\n\nIf no prefix is found amongst the staged files, only the choices `project` and empty will be given.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Commitizen plugin that prefixes commit messages with the common path or prefix of staged files.",
    "version": "0.0.1",
    "project_urls": {
        "Documentation": "https://cz-path.readthedocs.org",
        "Homepage": "https://tatsh.github.io/cz-path/",
        "Issues": "https://github.com/Tatsh/cz-path/issues",
        "Repository": "https://github.com/Tatsh/cz-path"
    },
    "split_keywords": [
        "commitizen",
        " commit messages",
        " git",
        " version control"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "38b4a336480bad9569a0164eafccf3f524ad551362b29ef4997caee6180a7802",
                "md5": "f7311dc4cc9a107dba90b155592e1290",
                "sha256": "a77f1d67917339f87ba396c036a3524d8493a0717b8c573c98b19ad7b69c98d5"
            },
            "downloads": -1,
            "filename": "cz_path-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f7311dc4cc9a107dba90b155592e1290",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.14,>=3.10",
            "size": 5322,
            "upload_time": "2025-07-14T02:01:19",
            "upload_time_iso_8601": "2025-07-14T02:01:19.514018Z",
            "url": "https://files.pythonhosted.org/packages/38/b4/a336480bad9569a0164eafccf3f524ad551362b29ef4997caee6180a7802/cz_path-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5f7efe0e7e0d0f6a79b7a45dd8e321c1ba7989ec89e196f2bdf146ae7683c97e",
                "md5": "0f6a6239c1059ab6993b67b004a7359c",
                "sha256": "cdb442b66fe2d846a81062393bd94f502a1529ffa397f5b59d6076b10d08657d"
            },
            "downloads": -1,
            "filename": "cz_path-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "0f6a6239c1059ab6993b67b004a7359c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.14,>=3.10",
            "size": 6330,
            "upload_time": "2025-07-14T02:01:20",
            "upload_time_iso_8601": "2025-07-14T02:01:20.562169Z",
            "url": "https://files.pythonhosted.org/packages/5f/7e/fe0e7e0d0f6a79b7a45dd8e321c1ba7989ec89e196f2bdf146ae7683c97e/cz_path-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-14 02:01:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Tatsh",
    "github_project": "cz-path",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "cz-path"
}
        
Elapsed time: 0.56728s