PHPackages                             anroots/pgca - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. anroots/pgca

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

anroots/pgca
============

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

0.2.1(11y ago)135MITPHPPHP &gt;=5.3.0

Since Apr 19Pushed 8y ago1 watchersCompare

[ Source](https://github.com/anroots/pgca)[ Packagist](https://packagist.org/packages/anroots/pgca)[ Docs](https://github.com/anroots/pgca)[ RSS](/packages/anroots-pgca/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (12)Versions (5)Used By (0)

PHP Git Commit Analyser
=======================

[](#php-git-commit-analyser)

[![Latest Version](https://camo.githubusercontent.com/b1e8585b07c53228eb508b668edca9abad29e3fd72e956a3cd4814233f5abcff/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f616e726f6f74732f706763612e7376673f7374796c653d666c61742d737175617265)](https://github.com/anroots/pgca/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/c585fbf02736c21f0644ab0d32fea40ca5a75608ccad6c3417c10c6344e117de/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f616e726f6f74732f706763612f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/anroots/pgca)[![Coverage Status](https://camo.githubusercontent.com/e6f5bbe6a8941c99c3b237115427227b48d4db6e821f0ac73be941a01e624489/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f616e726f6f74732f706763612e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/anroots/pgca/code-structure)[![Quality Score](https://camo.githubusercontent.com/08bd848f1ff0a6ee075880623025d63c963d1905f8d462bcd322291674103a14/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f616e726f6f74732f706763612e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/anroots/pgca)[![Quality Score](https://camo.githubusercontent.com/7ffeada12715d30b3b77a3a13ec833befe29447d69230904a01fb8fb41a01cfa/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f38336635663736392d626536632d343931332d386465332d3038366230376434356536312e737667)](https://insight.sensiolabs.com/projects/83f5f769-be6c-4913-8de3-086b07d45e61)[![Total Downloads](https://camo.githubusercontent.com/9eda3873e11ba131f00c764619990282a6042d185829248c5173a9c09d659f9e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616e726f6f74732f706763612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/anroots/pgca)

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](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).

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

Install
-------

[](#install)

- Include via Composer:

```
{
  "require": {
    "anroots/pgca": "~0.2"
  }
}
```

- Copy `config/pgca.yml` into your project root
- Customize the contents of `pgca.yml`

Usage
-----

[](#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
-------------

[](#documentation)

See [the wiki](https://github.com/anroots/pgca/wiki) for more documentation.

Requirements
------------

[](#requirements)

- PHP &gt;= 5.6
- [Composer](http://getcomposer.org)

Rules
-----

[](#rules)

See [the wiki](https://github.com/anroots/pgca/wiki/Rules) 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
-------

[](#testing)

```
$ phpunit
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Backlog
-------

[](#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
-------

[](#credits)

- [Ando Roots](https://github.com/anroots)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

3

Last Release

4039d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9bf4faf3916fe670192ed4355e97b6704d0dbb58dfb483a5e284131296a64ca0?d=identicon)[anroots](/maintainers/anroots)

---

Top Contributors

[![anroots](https://avatars.githubusercontent.com/u/469120?v=4)](https://github.com/anroots "anroots (103 commits)")

---

Tags

gitcommitpgcacommit analysiscommit message

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/anroots-pgca/health.svg)

```
[![Health](https://phpackages.com/badges/anroots-pgca/health.svg)](https://phpackages.com/packages/anroots-pgca)
```

###  Alternatives

[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5205.3M82](/packages/symplify-monorepo-builder)[ramsey/conventional-commits

A PHP library for creating and validating commit messages according to the Conventional Commits specification. Includes a CaptainHook action!

1931.2M122](/packages/ramsey-conventional-commits)[shyim/danger-php

Port of danger to PHP

8544.9k](/packages/shyim-danger-php)[symfony/ai-bundle

Integration bundle for Symfony AI components

30282.3k6](/packages/symfony-ai-bundle)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)[aeliot/todo-registrar

Register TODOs from source code in issue tracker

153.0k](/packages/aeliot-todo-registrar)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
