getchanges是一个用于检索变更日志的实用程序
getchanges的Python项目详细描述
getchanges旨在成为用于查找和检索更改日志的cli工具 任何包裹。这意味着:
- 系统包(apt,zypper,pacman,brew,…)
- 语言包(pip,gem,cargo,…)
- 即席脚本(curl https://foo.bar > /bin/foobar,…)
这个项目正在进行中!现在不要期望太多,避免 失望。
如果你想做出贡献-那太棒了,我总是乐于接受 一些帮手!你可以直接跳进去。
用法
最终的目标是:
$ changes [-sSOURCE] [--from FROM_VERSION] [--to TO_VERSION] NAME
其中:
OPTIONS: <NAME> Sets the name (of package / command) to search. -s, --source <SOURCE> Provides a source language restriction/hint. -f, --from <FROM> Outputs the Changelog beginning with this version. -t, --to <FROM> Outputs the Changelog ending with this version.
计划
我的计划是从要求源代码提示开始,这将使我建立一个 包源分析器库:
$ changes -spy coveralls # parses https://pypi.org/project/coveralls/ # finds https://github.com/coveralls-clients/coveralls-python/blob/master/CHANGELOG.md $ changes -sbrew ripgrep # parses https://github.com/Homebrew/homebrew-core/blob/master/Formula/awscli.rb # finds https://github.com/aws/aws-cli # locates https://github.com/aws/aws-cli/blob/develop/CHANGELOG.rst
我还想将此扩展到包含名称与 cli命令,例如,可以直接查找实用程序:
$ changes -sbrew rg # determines rg -> ripgrep # parses https://github.com/Homebrew/homebrew-core/blob/master/Formula/ripgrep.rb # finds https://github.com/BurntSushi/ripgrep # locates https://github.com/BurntSushi/ripgrep/blob/master/CHANGELOG.md
一旦覆盖了一些内容,我将展开“changelog locator”块:
$ changes -spy coverage # parses https://pypi.org/project/coverage/ # finds https://bitbucket.org/ned/coveragepy # links to https://github.com/nedbat/coveragepy # locates https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst $ changes -sgem mailchimp-api # parses https://rubygems.org/gems/mailchimp-api # finds https://bitbucket.org/mailchimp/mailchimp-api-ruby/ # locates https://bitbucket.org/mailchimp/mailchimp-api-ruby/compare/2.0.6..2.0.5
到目前为止,很明显有些项目会拒绝 很容易相处,所以我可能会想一个体面的 直接插入覆盖的方法。希望我能一直保持 不同的部分足够分开,以避免让这一步变成 头痛。
在这一点上,我可以使用changelog解析器——我意识到有无限的 这里有可能的选项,但是需要尽最大努力解析.md,.rst, NEWS、github版本和提交日志应该是一个不错的80%——特别是 如果我关注各种“标准”,比如conventional changelogs。
这将允许我添加版本范围标志 工作:
$ changes -srust clap --from v2.31.2 # parses https://github.com/clap-rs/clap/blob/master/CHANGELOG.md
最后,一个更通用的搜索功能可以一直玩到我结束 我的最终目标是:
$ changes hub --from 2.4.0 --to 2.5.1 # parses https://github.com/github/hub/releases
释放
- bumpsetup.py:版本
- 阻塞-c changelog.md-f–setversion=x.y.z
- git add setup.py changelog.md
- git commit-m'chore(发布版):bump version'
- git标记-a x.y.z–cleanup=whitespace