cz-kpn


Namecz-kpn JSON
Version 3.2.9 PyPI version JSON
download
home_pagehttps://github.com/kpn/cz-kpn
Summarycommitizen with kpn style
upload_time2024-04-25 12:53:33
maintainerNone
docs_urlNone
authorSantiago Fraire Willemoes
requires_python<4.0,>=3.9
licenseMIT
keywords commitizen release-management autorelease
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # KPN'S COMMITIZEN

[![PyPI Package latest release](https://img.shields.io/pypi/v/cz-kpn.svg?style=flat-square)](https://pypi.org/project/cz-kpn/)
[![PyPI Package download count (per month)](https://img.shields.io/pypi/dm/cz-kpn?style=flat-square)](https://pypi.org/project/cz-kpn/)
![Docker Image Version (latest by date)](https://img.shields.io/docker/v/kpnnl/cz-kpn?label=latest%20version)

![Example commit](docs/images/commit.gif)

## About

Plugin for [python's commitizen](https://commitizen-tools.github.io/commitizen/),
which uses KPN commit rules to bump versions, update files and generate changelogs.

## KPN Rules summary

### Schema

```bash
<PREFIX> <SUBJECT> (#<ISSUE_ID>)

<LONG_DESCRIPTION>
```

| Prefix  | SemVer relation | Description                                                        |
| ------- | --------------- | ------------------------------------------------------------------ |
| `FIX`   | `PATCH`         | Backwards compatible change that fixes something                   |
| `OPT`   | `PATCH`         | Other changes like refactors, docs, which are backwards compatible |
| `NEW`   | `MINOR`         | New functionality                                                  |
| `BREAK` | `MAJOR`         | Breaking changes                                                   |

### Example

```
NEW: Add login screen (#MY-123)
```

[MORE INFO](./src/cz_kpn/cz_kpn_info.txt)

## Installation

Install globally in your system

```bash
python -m pip install --user cz-kpn
```

Or add `cz-kpn` to your project:

```sh
poetry add cz-kpn --group dev
```

## Quickstart

### Initialize cz-kpn in your project

Answer the questions appearing in:

```sh
cz init
```

### Bumping and changelog

Just run:

```sh
cz bump
```

### Commiting

```sh
cz commit
```

or the shortcut

```sh
cz c
```

### With docker

```sh
cmd="cz -n cz_kpn commit"
docker run --rm -it -v $(pwd):/app kpnnl/cz-kpn:3.2.9 $cmd
```

## Features

### Client tool to assist in the creation of a commit

![Example commit](docs/images/commit.gif)]

note: gif is outdated

This command is useful for newcomers, or when you don't remember the meaning
of each change type.
It will display a prompt which will guide the user in the commit creation.

```bash
cz commit
```

```bash
git cz commit
```

### Automatic version bump

Automatic version bump with changelog generation.

```bash
cz bump --changelog
```

Note: The `--changelog` flag is not required if `update_changelog_on_bump = true`

![Example bump](docs/images/bump.gif)

### Automatic changelog generation

If you don't want to generate a tag and bump the version, run:

```bash
cz changelog
```

This will create a changelog with unreleased commits, alternatively, you can run

```bash
cz changelog --incremental
```

to add only the missing changes.
This is useful if you have manually modified your changelog.

### Validate commit message

This command will tell you if there are any valid or invalid commit messages in
the given range.

You can also add it to `.pre-commit` hooks or manually as a git hook.

More info in [commitizen website](https://commitizen-tools.github.io/commitizen/check/).

```bash
cz check --rev-range ugnu348hg84hg84g..j8fj84g84h84hg83h2392
```

### Adding commit link to the changelog

Add to the configuration the `commit_url` parameter, using `$COMMIT_REV` as
variable, you can take a look at this project's [.cz.toml](.cz.toml) as an example

```toml
[tool.commitizen]
...
commit_url = "https://YOUR_DOMAIN/projects/YOUR_GROUP/repos/YOUR_PROJECT/commits/$COMMIT_REV"
```

## Configuration

The recommendation is to run `cz init` which will help you create the
right configuration and file.

You can also add manually to your `pyproject.toml` or create a `.cz.toml` file with:

```toml
[tool.commitizen]
name = "cz_kpn"
version = "<YOUR_CURRENT_VERSION>"
version_files = [
  "src/__version__.py"
]
slack_channel = "ddci-notifications"
```

## Help

```bash
cz --help
```

Contents:

```bash
$ cz --help
Commitizen is a cli tool to generate conventional commits.
For more information about the topic go to https://conventionalcommits.org/

options:
  -h, --help            show this help message and exit
  --debug               use debug mode
  -n NAME, --name NAME  use the given commitizen (default: cz_conventional_commits)
  -nr NO_RAISE, --no-raise NO_RAISE
                        comma separated error codes that won't rise error, e.g: cz -nr 1,2,3 bump. See codes at
                        https://commitizen-tools.github.io/commitizen/exit_codes/

commands:
  {init,commit,c,ls,example,info,schema,bump,changelog,ch,check,version}
    init                init commitizen configuration
    commit (c)          create new commit
    ls                  show available commitizens
    example             show commit example
    info                show information about the cz
    schema              show commit schema
    bump                bump semantic version based on the git log
    changelog (ch)      generate changelog (note that it will overwrite existing file)
    check               validates that a commit message matches the commitizen schema
    version             get the version of the installed commitizen or the current project (default: installed commitizen)
```

## Contributing

Read [Contributing guide](./CONTIRBUTING.md)

## Using in a github action

```yaml
name: Bump version and generate changelog

on:
  push:
    branches:
      - main

jobs:
  bump-version:
    if: "!startsWith(github.event.head_commit.message, 'BUMP:')"
    runs-on: ubuntu-latest
    name: "Bump version and create changelog with commitizen"
    steps:
      - name: Check out
        uses: actions/checkout@v3
        with:
          fetch-depth: 0
          token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
      - name: Create bump and changelog
        uses: commitizen-tools/commitizen-action@master
        with:
          github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
          changelog_increment_filename: body.md
          extra_requirements: "cz-kpn"
      - name: Release
        uses: softprops/action-gh-release@v1
        with:
          body_path: "body.md"
          tag_name: ${{ env.REVISION }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```

Read more in [commitizen docs](https://commitizen-tools.github.io/commitizen/tutorials/github_actions/)


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/kpn/cz-kpn",
    "name": "cz-kpn",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "commitizen, release-management, autorelease",
    "author": "Santiago Fraire Willemoes",
    "author_email": "santiago.fraire@kpn.com",
    "download_url": "https://files.pythonhosted.org/packages/70/1a/fd925c7c26d1384edfa1476a70c5ea8efbaff010877b1449b15df1f17498/cz_kpn-3.2.9.tar.gz",
    "platform": null,
    "description": "# KPN'S COMMITIZEN\n\n[![PyPI Package latest release](https://img.shields.io/pypi/v/cz-kpn.svg?style=flat-square)](https://pypi.org/project/cz-kpn/)\n[![PyPI Package download count (per month)](https://img.shields.io/pypi/dm/cz-kpn?style=flat-square)](https://pypi.org/project/cz-kpn/)\n![Docker Image Version (latest by date)](https://img.shields.io/docker/v/kpnnl/cz-kpn?label=latest%20version)\n\n![Example commit](docs/images/commit.gif)\n\n## About\n\nPlugin for [python's commitizen](https://commitizen-tools.github.io/commitizen/),\nwhich uses KPN commit rules to bump versions, update files and generate changelogs.\n\n## KPN Rules summary\n\n### Schema\n\n```bash\n<PREFIX> <SUBJECT> (#<ISSUE_ID>)\n\n<LONG_DESCRIPTION>\n```\n\n| Prefix  | SemVer relation | Description                                                        |\n| ------- | --------------- | ------------------------------------------------------------------ |\n| `FIX`   | `PATCH`         | Backwards compatible change that fixes something                   |\n| `OPT`   | `PATCH`         | Other changes like refactors, docs, which are backwards compatible |\n| `NEW`   | `MINOR`         | New functionality                                                  |\n| `BREAK` | `MAJOR`         | Breaking changes                                                   |\n\n### Example\n\n```\nNEW: Add login screen (#MY-123)\n```\n\n[MORE INFO](./src/cz_kpn/cz_kpn_info.txt)\n\n## Installation\n\nInstall globally in your system\n\n```bash\npython -m pip install --user cz-kpn\n```\n\nOr add `cz-kpn` to your project:\n\n```sh\npoetry add cz-kpn --group dev\n```\n\n## Quickstart\n\n### Initialize cz-kpn in your project\n\nAnswer the questions appearing in:\n\n```sh\ncz init\n```\n\n### Bumping and changelog\n\nJust run:\n\n```sh\ncz bump\n```\n\n### Commiting\n\n```sh\ncz commit\n```\n\nor the shortcut\n\n```sh\ncz c\n```\n\n### With docker\n\n```sh\ncmd=\"cz -n cz_kpn commit\"\ndocker run --rm -it -v $(pwd):/app kpnnl/cz-kpn:3.2.9 $cmd\n```\n\n## Features\n\n### Client tool to assist in the creation of a commit\n\n![Example commit](docs/images/commit.gif)]\n\nnote: gif is outdated\n\nThis command is useful for newcomers, or when you don't remember the meaning\nof each change type.\nIt will display a prompt which will guide the user in the commit creation.\n\n```bash\ncz commit\n```\n\n```bash\ngit cz commit\n```\n\n### Automatic version bump\n\nAutomatic version bump with changelog generation.\n\n```bash\ncz bump --changelog\n```\n\nNote: The `--changelog` flag is not required if `update_changelog_on_bump = true`\n\n![Example bump](docs/images/bump.gif)\n\n### Automatic changelog generation\n\nIf you don't want to generate a tag and bump the version, run:\n\n```bash\ncz changelog\n```\n\nThis will create a changelog with unreleased commits, alternatively, you can run\n\n```bash\ncz changelog --incremental\n```\n\nto add only the missing changes.\nThis is useful if you have manually modified your changelog.\n\n### Validate commit message\n\nThis command will tell you if there are any valid or invalid commit messages in\nthe given range.\n\nYou can also add it to `.pre-commit` hooks or manually as a git hook.\n\nMore info in [commitizen website](https://commitizen-tools.github.io/commitizen/check/).\n\n```bash\ncz check --rev-range ugnu348hg84hg84g..j8fj84g84h84hg83h2392\n```\n\n### Adding commit link to the changelog\n\nAdd to the configuration the `commit_url` parameter, using `$COMMIT_REV` as\nvariable, you can take a look at this project's [.cz.toml](.cz.toml) as an example\n\n```toml\n[tool.commitizen]\n...\ncommit_url = \"https://YOUR_DOMAIN/projects/YOUR_GROUP/repos/YOUR_PROJECT/commits/$COMMIT_REV\"\n```\n\n## Configuration\n\nThe recommendation is to run `cz init` which will help you create the\nright configuration and file.\n\nYou can also add manually to your `pyproject.toml` or create a `.cz.toml` file with:\n\n```toml\n[tool.commitizen]\nname = \"cz_kpn\"\nversion = \"<YOUR_CURRENT_VERSION>\"\nversion_files = [\n  \"src/__version__.py\"\n]\nslack_channel = \"ddci-notifications\"\n```\n\n## Help\n\n```bash\ncz --help\n```\n\nContents:\n\n```bash\n$ cz --help\nCommitizen is a cli tool to generate conventional commits.\nFor more information about the topic go to https://conventionalcommits.org/\n\noptions:\n  -h, --help            show this help message and exit\n  --debug               use debug mode\n  -n NAME, --name NAME  use the given commitizen (default: cz_conventional_commits)\n  -nr NO_RAISE, --no-raise NO_RAISE\n                        comma separated error codes that won't rise error, e.g: cz -nr 1,2,3 bump. See codes at\n                        https://commitizen-tools.github.io/commitizen/exit_codes/\n\ncommands:\n  {init,commit,c,ls,example,info,schema,bump,changelog,ch,check,version}\n    init                init commitizen configuration\n    commit (c)          create new commit\n    ls                  show available commitizens\n    example             show commit example\n    info                show information about the cz\n    schema              show commit schema\n    bump                bump semantic version based on the git log\n    changelog (ch)      generate changelog (note that it will overwrite existing file)\n    check               validates that a commit message matches the commitizen schema\n    version             get the version of the installed commitizen or the current project (default: installed commitizen)\n```\n\n## Contributing\n\nRead [Contributing guide](./CONTIRBUTING.md)\n\n## Using in a github action\n\n```yaml\nname: Bump version and generate changelog\n\non:\n  push:\n    branches:\n      - main\n\njobs:\n  bump-version:\n    if: \"!startsWith(github.event.head_commit.message, 'BUMP:')\"\n    runs-on: ubuntu-latest\n    name: \"Bump version and create changelog with commitizen\"\n    steps:\n      - name: Check out\n        uses: actions/checkout@v3\n        with:\n          fetch-depth: 0\n          token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}\n      - name: Create bump and changelog\n        uses: commitizen-tools/commitizen-action@master\n        with:\n          github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}\n          changelog_increment_filename: body.md\n          extra_requirements: \"cz-kpn\"\n      - name: Release\n        uses: softprops/action-gh-release@v1\n        with:\n          body_path: \"body.md\"\n          tag_name: ${{ env.REVISION }}\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n```\n\nRead more in [commitizen docs](https://commitizen-tools.github.io/commitizen/tutorials/github_actions/)\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "commitizen with kpn style",
    "version": "3.2.9",
    "project_urls": {
        "Homepage": "https://github.com/kpn/cz-kpn",
        "Repository": "https://github.com/kpn/cz-kpn"
    },
    "split_keywords": [
        "commitizen",
        " release-management",
        " autorelease"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "253136431692a3388853398e2e0314fe52435be3a47287da98f1fb941ef2c148",
                "md5": "c3911dbd02600f9565e22e1e7cd1b6f8",
                "sha256": "70e4a5184112b95cdffe37889de919067890d33735c2df54aede17f90db0d78f"
            },
            "downloads": -1,
            "filename": "cz_kpn-3.2.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c3911dbd02600f9565e22e1e7cd1b6f8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 804197,
            "upload_time": "2024-04-25T12:53:31",
            "upload_time_iso_8601": "2024-04-25T12:53:31.619569Z",
            "url": "https://files.pythonhosted.org/packages/25/31/36431692a3388853398e2e0314fe52435be3a47287da98f1fb941ef2c148/cz_kpn-3.2.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "701afd925c7c26d1384edfa1476a70c5ea8efbaff010877b1449b15df1f17498",
                "md5": "127d5d27d8b73a2e4105cbca41e29bc8",
                "sha256": "f5b01047f19264d96e826671bd1897a7ec35dc9a96319b7e1177c67a86e7dd37"
            },
            "downloads": -1,
            "filename": "cz_kpn-3.2.9.tar.gz",
            "has_sig": false,
            "md5_digest": "127d5d27d8b73a2e4105cbca41e29bc8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 806367,
            "upload_time": "2024-04-25T12:53:33",
            "upload_time_iso_8601": "2024-04-25T12:53:33.015474Z",
            "url": "https://files.pythonhosted.org/packages/70/1a/fd925c7c26d1384edfa1476a70c5ea8efbaff010877b1449b15df1f17498/cz_kpn-3.2.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-25 12:53:33",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "kpn",
    "github_project": "cz-kpn",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "cz-kpn"
}
        
Elapsed time: 0.23952s