帮助您按照提交约定编写提交的python程序
commit-helper-testing的Python项目详细描述
提交帮助程序
它是做什么的?
commit助手正是按照它的名字来做的:通过将commit消息裁剪成commit约定来帮助您创建和维护commit策略。
我为什么要用这个?
保持承诺策略听起来很容易,但实际上我们都知道它不是这样的。
有时,我们,开发人员,在编程时去full loco并在提交时出错。没关系,每个人都会犯错。但是,如果这些错误可以避免呢?
屏幕截图
初始提交
正常提交
提交而不生成配置文件
共同撰写的提交
快速提交
调试和调试
一体式提交
帮助
在约定中获得写作帮助
安装
为了安装一个旧版本,请检查previous releases。要安装最新(PIP)版本,只需执行以下命令:
$ pip3 install commit-helper
更新当前版本
如果您的计算机中已经安装了我们的一个pip
版本,并且要更新到最新版本,请使用以下命令:
$ pip3 install --upgrade commit-helper
使用和配置
这个程序有一个可以利用的cli。正在运行commit --help
将显示提交的用法和选项。所有这些都是可选的
为了不失去你宝贵的时间。
$ commit -h usage: commit [-h][-t TAG][-m MESSAGE][-ct CONTEXT][-ca CO_AUTHOR][-nf][-c {angular,karma,tagged,symphony,message}][-d] A commit formatter tool to help you follow commit conventions. optional arguments: -h, --help show this help message and exit -t TAG, --tag TAG Pass your commit tag directly -m MESSAGE, --message MESSAGE Pass your commit message directly -ct CONTEXT, --context CONTEXT Pass your commit context directly -ca CO_AUTHOR, --co-author CO_AUTHOR Make your friend an co-author to the commit -nf, --no-file Disables the creation of a commiter.yml file -c {angular,karma,tagged,symphony,message}, --convention {angular,karma,tagged,symphony,message} Selects a convention to be used for the commit. Required if there's no commiter.yml file. -d, --debug Toggles debug option
因此,如果要编写共同编写的提交,应使用:
$ commit --co-author "foo bar doritous <foobar@douritos.com>"
或者如果您是第一次在项目中使用此功能:
$ commit --convention tagged
为了更顺利地工作,在工作目录中有一个名为committer.yml的文件。在此文件中,必须通过要使用的提交约定,如下例:
convention:angular # tag(context):commit message# orconvention:karma # tag(context):commit message# orconvention:tagged # TAG:commit message# orconvention:symphony# [Tag] commit message# and if you're feeling adventurousconvention:none# Commit message
如果您或您的组织已经有了上面未列出的提交约定,您可以在committer.yml文件中对其进行如下配置:
convention:custom# considering a commit message like '{add} (stuff) ~> in file foo.br'commit_pattern:'{tag}(context)~>message'# tag, message and context are reserved words that will be replaced in your commit messagecontext:true# this is a must have field! If your pattern doesn't have one, assign false to it
支持的约定:
- 角度
- 业力
- 标记
- 交响乐
- 原子
- 仅消息(无约定)
- 您可以创建一个自定义的:)
故障排除
如果在安装commit helper之后,commit
或commit-helper
命令在命令行中不可用,请检查$HOME/.local/bin
是否在您的路径上。如果没有,请运行以下命令将其添加到.bashrc文件中:
$ echo"export PATH=$HOME/.local/bin:$PATH" >> .bashrc
项目维护人员
Name | Username |
---|---|
André de Sousa Costa Filho | @andre-filho |
我们的合作者
Name | Username |
---|---|
Arthur José Benedito de Oliveira Assis | @arthur0496 |
Matheus Richard Torres Gomes de Melo | @MatheusRich |