基于github里程碑或标记生成变更日志

loghub的Python项目详细描述


项目详细信息

LicenseLatest PyPI versionJoin the chat at https://gitter.im/spyder-ide/publicOpenCollective BackersOpenCollective Sponsors

生成状态

Travis-CI build statusAppveyor build statusCircle-CI build statusCode CoverageScrutinizer Code Quality

重要声明:Spyder没有资金!

自2017年11月中旬以来,Anaconda, Inc 在过去18年停止为Spyder Development提供资金 月。因此,从现在起,开发将集中于维护 Spyder 3的速度比以前慢得多。

如果您想为维护Spyder做出贡献,请考虑在

https://opencollective.com/spyder

我们非常感谢你能为我们提供的一切帮助 支持Spyder开发和Spyder开发工作。

如果你想了解更多,请阅读 page

说明

基于github里程碑或标记的变更日志生成器。

示例输出

那么这在实践中看起来如何呢?loghub的0.3版本看起来是这样的:

## Version 0.3 (2017-10-10)

### Issues Closed

#### Enhancements

* [Issue 63](https://github.com/spyder-ide/loghub/issues/63) - Add PR link / commit link inside issue ([PR 69](https://github.com/spyder-ide/loghub/pull/69))

In this release 1 issue was closed.

### Pull Requests Merged

* [PR 69](https://github.com/spyder-ide/loghub/pull/69) - PR: Add extra links for related issues and prs ([63](https://github.com/spyder-ide/loghub/issues/63))

In this release 1 pull request was closed.

您可以查看loghub’s CHANGELOG.md,或spyder’s CHANGELOG.md 更完整的示例输出

安装

使用pip

pip install loghub

使用conda

conda install loghub -c conda-forge

conda install loghub -c spyder-ide

用法

loghub可用于根据里程碑或标记生成变更日志。

在使用里程碑跟踪发布的项目中,我们可以使用例如:

loghub spyder-ide/spyder --milestone v3.0

在项目中,里程碑用于跟踪大块的工作,而不是发布, 我们可以使用标记获取最新版本后的更改,例如:

loghub spyder-ide/spyder --since-tag v3.0.0b7

或者如果loghub用于生成旧的变更日志(或更新变更日志), 我们还可以使用标记来限制范围,例如:

loghub spyder-ide/spyder --since-tag v3.0.0b7 --until-tag v3.0.0

对于私有回购,只需添加用户名和密码参数,例如:

loghub spyder-ide/spyder --since-tag v3.0.0b7 --since-tag v3.0.0 --username <username> --password <password>

或者,只需添加用户名,就会出现密码提示,例如:

loghub spyder-ide/spyder --since-tag v3.0.0b7 --since-tag v3.0.0 --username <username>

或者生成一个github访问令牌并使用它,例如:

loghub spyder-ide/spyder --since-tag v3.0.0b7 -until-tag v3.0.0 --token <token>

重要

由于github api的速率限制,建议始终使用身份验证 通过访问令牌或用户和密码。

高级用法

过滤pr基分支

要显示的拉取请求可以根据其所在的分支进行筛选 合并到(基分支):

loghub spyder-ide/spyder --branch 3.x

按标签筛选问题/prs

要筛选要显示的问题,可以使用正则表达式:

loghub spyder-ide/spyder --issue-label-regex "Type.*" --milestone v3.1

这将筛选所有以type

开头的问题

对于prs也可以这样做

loghub spyder-ide/spyder --pr-label-regex "<some-regex>" --milestone v3.1

按标签分组问题

显示的问题可以按标签分组:

loghub spyder-ide/spyder --issue-label-group "Type-Bug" "Bugs Fixed" --issue-label-group "Type-Enhancement" "New Features" --milestone v3.1

这将导致问题被分为两个标题部分 bugs分别修复了new features

输出格式

loghub提供两种格式:

  • *changelog*,这是默认设置,包括指向问题和prs的链接
  • *release*,其中不包括链接
loghub spyder-ide/spyder --milestone v3.1 --format release

自定义模板

loghub使用jinja2模板来格式化输出。如果当前模板 不是您的需要,您可以复制默认的templates 并创建一个新的路径:

loghub spyder-ide/spyder --milestone v3.1 --template <PATH_TO_TEMPLATE>

详细的cli参数

usage: loghub [-h] [-m MILESTONE]
              [-ilg ISSUE_LABEL_GROUPS [ISSUE_LABEL_GROUPS ...]]
              [-ilr ISSUE_LABEL_REGEX] [-plr PR_LABEL_REGEX] [-st SINCE_TAG]
              [-ut UNTIL_TAG] [-b BRANCH] [-f OUTPUT_FORMAT]
              [--template TEMPLATE] [-u USERNAME] [-p PASSWORD] [-t TOKEN]
              repository

Script to print the list of issues and pull requests closed in a given
milestone, tag including additional filtering options.

positional arguments:
  repository            Repository name to generate the Changelog for, in the
                        form user/repo or org/repo (e.g. spyder-ide/spyder)

optional arguments:
  -h, --help
                        Show this help message and exit

  -u USERNAME, --username USERNAME
                        Github user name

  -p PASSWORD, --password PASSWORD
                        Github user password

  -t TOKEN, --token TOKEN
                        Github access token

  -m MILESTONE, --milestone MILESTONE
                        Github milestone to get issues and pull requests for

  -st SINCE_TAG, --since-tag SINCE_TAG
                        Github issues and pull requests since tag

  -ut UNTIL_TAG, --until-tag UNTIL_TAG
                        Github issues and pull requests until tag

  -ilg ISSUE_LABEL [TEXT TO PRINT], --issue-label-group ISSUE_LABEL [TEXT TO PRINT]
                        Groups the generated issues by the specified label.
                        This option takes 1 or 2 arguments, where the first one
                        is the label to match and the second one is the label
                        to print on the final output

  -ilr ISSUE_LABEL_REGEX, --issue-label-regex ISSUE_LABEL_REGEX
                        Label issue filter using a regular expression filter

  -plr PR_LABEL_REGEX, --pr-label-regex PR_LABEL_REGEX
                        Label pull requets filter using a regular expression
                        filter

  -b BRANCH, --branch BRANCH
                        Filter merged PRs on base branch

  -f OUTPUT_FORMAT, --format OUTPUT_FORMAT
                        Format for print, either 'changelog' (for Changelog.md
                        file) or 'release' (for the Github Releases page).
                        Default is 'changelog'. The 'release' option doesn't
                        generate Markdown hyperlinks.

  -te, --template TEMPLATE
                        Use a custom Jinja2 template file

  --batch {milestones,tags}
                        Run loghub for all milestones or all tags

  --no-prs              Run loghub without any pull requests output

label utility cli参数

loghub包含一个额外的实用程序来获取或更新标签。

usage: loghub-labels [-h] [-u USERNAME] [-p PASSWORD] [-t TOKEN]
                     [-a [{get,update}]] [-f FILENAME]
                     repository

positional arguments:
  repository            Repository name to generate the Changelog for, in the
                        form user/repo or org/repo (e.g. spyder-ide/spyder)

optional arguments:
  -h, --help
                        show this help message and exit

  -u USERNAME, --username USERNAME
                        Github user name

  -p PASSWORD, --password PASSWORD
                        Github user password

  -t TOKEN, --token TOKEN
                        Github access token

  -a [{get,update}], --action [{get,update}]
                        Action to take

  -f FILENAME, --filename FILENAME
                        File for storing labels

贡献

欢迎大家贡献!

支持者

每月捐款支持我们,并帮助我们继续我们的活动。

Backers

赞助商

成为我们Github自述文件的赞助商。

Sponsors

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java最终变量可能尚未初始化   springsecurity中的java MySQL查询。用于授权的xml   java My servlet返回null   多线程如何修复java。util。同时发生的CompletionException:java。StackOverflowerr先生   java在找不到请求的页面或方法时如何定义全局页面?   java连接到UI线程安全Android   如何在java中去除图像的白色背景   java Group在SQL或代码中更好地聚合了数据(在性能方面)   JavaAndroid:在Eclipse的图形布局编辑器中自由移动按钮   java单元测试Mockito MyBatis为返回布尔值的selectone引发空指针异常   如何使用aes在java中加密/解密文件?   java在使用复制构造函数时并发修改列表