定制 anroots/pgca 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

anroots/pgca

最新稳定版本:0.2.1

Composer 安装命令:

composer require anroots/pgca

包简介

Analyzes Git commit messages for poor committing practices and reports a list of violations

README 文档

README

Latest Version Software License Build Status Coverage Status Quality Score Quality Score Total Downloads

A CLI tool which analyses Git commits for violations.

This project aims to improve the quality of your commit practices by applying a set of rules against your commit (message) and then yelling at you when you get too lazy.

The project was born from frustration of seeing commit messages like "fix some stuff" and people's inability to write good commit messages.

Development status: Alpha, ongoing. Unstable public API. Is usable.

Install

  • Include via Composer:
{ 
  "require": {
    "anroots/pgca": "~0.2"
  }
}
  • Copy config/pgca.yml into your project root
  • Customize the contents of pgca.yml

Usage

To analyze the commit history of the current project, run the analyzer from the command line:

athena PhpstormProjects/todo-app ‹develop*› » vendor/bin/pgca analyze       
PGCA report, generated on 2015-04-25 11:01:04
+---------+------------+-------------------------+--------------------------------------------------+
| Commit  | Author     | Commit Message          | Explanation                                      |
+---------+------------+-------------------------+--------------------------------------------------+
| 2dda109 | Ando Roots | Add a note to the RE... | The Summary line should be 50 or less characters |
| 342a207 | Ando Roots | Readme additions        | Commit message is really short                   |
| 8ba29a8 | Ando Roots | Add five new Rules      | Commit message is really short                   |
| a7c97f9 | Ando Roots | Refactor AbstractRul... | The Summary line should be 50 or less characters |
| 9a43610 | Ando Roots | Reformat code           | Commit message is really short                   |
| 2b29b55 | Ando Roots | Allow to pass option... | The Summary line should be 50 or less characters |
| 2efbbe5 | Ando Roots | Add --limit and --fr... | The Summary line should be 50 or less characters |
+---------+------------+-------------------------+--------------------------------------------------+
Found a total of 80 commits, skipped 0 and analyzed 80 of them.
The total score was 7

You can customize the analysis in the pgca.yml file and with CLI options.

Print the "simple" report in table format to the console and analyse the last 40 Git commits of the current branch:

$ vendor/bin/pgca analyze --report-printer=console --report-serializer=console --report-composer=simple --provider-revision=HEAD~40..HEAD                                                                                       1 ↵
PGCA report, generated on 2015-04-12 15:08:06
+---------+------------+-------------------------+--------------------------------------------------+
| Commit  | Author     | Commit Message          | Explanation                                      |
+---------+------------+-------------------------+--------------------------------------------------+
| 342a207 | Ando Roots | Readme additions        | Commit message is really short                   |
| 8ba29a8 | Ando Roots | Add five new Rules      | Commit message is really short                   |
| a7c97f9 | Ando Roots | Refactor AbstractRul... | The Summary line should be 50 or less characters |
+---------+------------+-------------------------+--------------------------------------------------+
Found a total of 40 commits, skipped 0 and analyzed 40 of them.
The total score was 3

Documentation

See the wiki for more documentation.

Requirements

Rules

See the wiki for documentation about standard rules. For a full list of available rules, run vendor/bin/pgca/rules:list:

$ vendor/bin/pgca rules:list
+-------------------------------------+----------+
| Name                                | Category |
+-------------------------------------+----------+
| message.hasSummaryAndDescription    | Message  |
| message.isLongEnough                | Message  |
| message.startsWithCapitalLetter     | Message  |
| message.summaryFiftyOrLessChars     | Message  |
| message.oneBlankLineAfterSummary    | Message  |
| message.noTrailingWhitespace        | Message  |
| message.noTrailingNewline           | Message  |
| message.noDoubleWhitespace          | Message  |
| message.allLinesLessThanThreshold   | Message  |
| message.notTypicalNonsense          | Message  |
| message.noProfanity                 | Message  |
| message.noProfanity                 | Message  |
| message.summaryDoesNotEndWithPeriod | Message  |
| content.hasNoIgnoredFiles           | Content  |
+-------------------------------------+----------+

Testing

$ phpunit

Contributing

Please see CONTRIBUTING for details.

Backlog

These are the broader topics that need improvement and are planned in the undefined near future:

Rule implementations

  • [message] summary is in present / imperative form
  • [message] has ticket reference in commit message
  • [message] is in English
  • [content] commit does not contain excessive changed file count (commits that change 100 files)

Refactoring

  • Add more in-code documentation
  • Increase unit test coverage
  • Refactor code, from alpha version to 1.0 quality
  • Improve HTML report
  • Add longer 'explanation' block to all rules. Might be 2-3 paragraphs with examples and a long explanation why this particular rule exists

Credits

License

The MIT License (MIT). Please see License File for more information.

anroots/pgca 适用场景与选型建议

anroots/pgca 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 35 次下载、GitHub Stars 达 1, 最近一次更新时间为 2015 年 04 月 04 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「git」 「commit」 「pgca」 「commit analysis」 「commit message」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 anroots/pgca 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 anroots/pgca 我们能提供哪些服务?
定制开发 / 二次开发

基于 anroots/pgca 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 35
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 26
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-04-04