跳转到主要内容

Python commitizen 客户端工具

项目描述

GitHub Workflow Status Conventional Commits PyPI Package latest release PyPI Package download count (per month) Supported versions homebrew Codecov pre-commit

Using commitizen cli


文档: https://commitizen-tools.github.io/commitizen/


关于

Commitizen是一个为团队设计的发布管理工具。

Commitizen假定您的团队使用标准的提交规则,并在此基础上,它可以增加您项目的版本,创建变更日志,并更新文件。

默认情况下,commitizen使用常规提交,但您可以构建自己的规则集,并发布它们。

使用标准化的规则集来编写提交,使得提交更容易阅读,并强制编写描述性提交。

功能

  • 基于您规则的命令行工具来创建提交。默认:常规提交
  • 根据提交自动提升版本,使用语义版本控制了解更多
  • 使用Keep a changelog生成变更日志
  • 自动更新您项目的版本文件
  • 显示有关您的提交规则(命令:schema, example, info)的信息
  • 创建您自己的规则集并将其发布到pip。有关自定义的更多信息,请参阅自定义

要求

Python 3.8+

Git 1.8.5.2+

安装

使用pipx在您的系统中安装commitizen(推荐,https://pypa.github.io/pipx/installation/

pipx ensurepath
pipx install commitizen
pipx upgrade commitizen

使用带有--user标志的pip安装commitizen

pip install --user -U commitizen

Python项目

您可以使用以下方法将其添加到本地项目

pip install -U commitizen

对于Poetry >= 1.2.0

poetry add commitizen --group dev

对于Poetry < 1.2.0

poetry add commitizen --dev

macOS

通过homebrew

brew install commitizen

使用说明

大多数情况下,您只需运行这个命令

cz bump

除此之外,您还可以使用commitizen来帮助您创建提交

cz commit

更多内容请参阅入门指南

帮助

$ cz --help
usage: cz [-h] [--debug] [-n NAME] [-nr NO_RAISE] {init,commit,c,ls,example,info,schema,bump,changelog,ch,check,version} ...

Commitizen is a cli tool to generate conventional commits.
For more information about the topic go to https://conventionalcommits.org/

optional arguments:
  -h, --help            show this help message and exit
  --config              the path of configuration file
  --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)

设置bash自动完成

当使用bash作为您的shell时(对zsh、fish和tcsh的支持有限),Commitizen可以使用argcomplete进行自动完成。为此,需要启用argcomplete。

当您安装Commitizen时,argcomplete会自动安装,因为它是依赖项。

如果Commitizen是全局安装的,则可以执行全局激活

sudo activate-global-python-argcomplete

对于永久(但不是全局)的Commitizen激活,请使用

register-python-argcomplete cz >> ~/.bashrc

对于仅一次激活Commitizen的argcomplete,请使用

eval "$(register-python-argcomplete cz)"

有关激活的更多信息,请访问argcomplete网站

赞助商

这些都是我们的酷赞助商!

项目详情


发布历史 发布通知 | RSS订阅

下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。

源代码分发

commitizen-3.29.1.tar.gz (50.7 kB 查看哈希值)

上传时间 源代码

构建分发

commitizen-3.29.1-py3-none-any.whl (71.8 kB 查看哈希值)

上传时间 Python 3

由以下支持