Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .DS_Store
Binary file not shown.
22 changes: 22 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Static analysis

on:
push:
branches: [main]
pull_request:

permissions:
contents: read

jobs:
pint:
name: Pint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
with:
php-version: '8.4'
coverage: none
- run: composer update --prefer-dist --no-interaction
- run: vendor/bin/pint --test
29 changes: 29 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Tests

on:
push:
branches: [main]
pull_request:

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['8.4', '8.5']
stability: [prefer-lowest, prefer-stable]

name: PHP ${{ matrix.php }} · ${{ matrix.stability }}

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
with:
php-version: ${{ matrix.php }}
coverage: none
- run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- run: vendor/bin/pest --ci
28 changes: 26 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
## 1.0.0 - 2023-03-25
# Changelog

- First release.
All notable changes to `laranail/git-commit-checker` are documented in this file.

The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

_Nothing yet._

## v0.1.0

### Changed

- **Public names are vendor-scoped.** The config key is `laranail.git-commit-checker` and the view namespace
`laranail/git-commit-checker`, where both were the bare `git-commit-checker`. Publish tags were already scoped.
Breaking for anyone reading the old names.
- **PHP `>=8.0` → `^8.4.1 || ^8.5`**, the family floor.
- **Requires the `illuminate/*` components it uses** rather than `laravel/framework`.
- **`laravel/pint` moved to `require-dev`.** It was in `require`, forcing a dev tool into every
consuming application.

### Added

- A test suite and CI, neither of which this package had.
- `LICENSE` (MIT), and a `docs/` tree.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Simtabi LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
69 changes: 15 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,29 @@
![banner](.github/assets/banner.png?raw=true)
# laranail/git-commit-checker

Git Commit Checker
============
A highly opinionated Git pre-commit hooks for coding standards checking, and syntax fixing for the Laravel framework.
[![Packagist](https://img.shields.io/packagist/v/laranail/git-commit-checker.svg)](https://packagist.org/packages/laranail/git-commit-checker)
[![Tests](https://github.com/laranail/git-commit-checker/actions/workflows/tests.yml/badge.svg)](https://github.com/laranail/git-commit-checker/actions/workflows/tests.yml)
[![Static analysis](https://github.com/laranail/git-commit-checker/actions/workflows/static-analysis.yml/badge.svg)](https://github.com/laranail/git-commit-checker/actions/workflows/static-analysis.yml)
[![License MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

Requirements
============
> Git pre-commit hooks for coding-standard and syntax checks in Laravel projects.

To be able to use this package you need to meet the following minimum requirements:
1. Laravel framework >= v9
2. PHP >= v8.0
Requires PHP `^8.4.1 || ^8.5` and Laravel `^13.0`.

****

## Installation

You can install the package via composer:

```shell
composer require laranail/git-commit-checker
```

To publish views and config files for further manipulation, run the following commands:
## Install

```bash
php artisan vendor:publish laranail::git-commit-checker-config
php artisan vendor:publish laranail::git-commit-checker-views
```

### Install GIT hooks

Run this command to install:

```shell
php artisan git-commit-checker:install
```

Run test manually (made sure you've added all changed files to git stage):

```shell
php artisan git-commit-checker:pre-commit-hook
composer require laranail/git-commit-checker
```

### Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

## Contributing

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

### Security

If you discover any security related issues, please email minhsang2603@gmail.com instead of using the issue tracker.
## <a name="documentation"></a>Documentation

Credits
============
This project wouldn't have been possible without the inspiration and ideas borrowed from many sources across the open source community,
we say thank you to the respective authors.
Full documentation is at
**[opensource.simtabi.com/documentation/laranail/git-commit-checker](https://opensource.simtabi.com/documentation/laranail/git-commit-checker/)**.

## Contributors
### Project

- [All Contributors](CONTRIBUTORS.md)
- [Architecture](docs/architecture.md) — what this package registers, and under which names.

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
MIT. See [LICENSE](LICENSE).
121 changes: 67 additions & 54 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,57 +1,70 @@
{
"name": "laranail/git-commit-checker",
"description": "A highly opinionated Git pre-commit hooks for coding standards checking, and syntax fixing for the Laravel framework.",
"type": "package",
"license": "MIT",
"keywords": [
"simtabi",
"simtabi cms",
"simtabi platform",
"simtabi git commit checker",
"git",
"commit checker"
],
"homepage": "https://simtabi.com",
"authors": [
{
"name": "Imani Manyara",
"role": "Developer",
"homepage": "https://simtabi.com"
"name": "laranail/git-commit-checker",
"description": "Git pre-commit hooks for coding-standard and syntax checks in Laravel projects.",
"type": "package",
"license": "MIT",
"keywords": [
"simtabi",
"simtabi cms",
"simtabi platform",
"simtabi git commit checker",
"git",
"commit checker"
],
"homepage": "https://opensource.simtabi.com/products/laranail/git-commit-checker",
"authors": [
{
"name": "Imani Manyara",
"role": "Developer",
"homepage": "https://simtabi.com"
},
{
"name": "Easter Mukora",
"role": "Developer",
"homepage": "https://simtabi.com"
}
],
"autoload": {
"psr-4": {
"Simtabi\\Laranail\\GitCommitChecker\\": "src"
}
},
{
"name": "Easter Mukora",
"role": "Developer",
"homepage": "https://simtabi.com"
}
],
"autoload": {
"psr-4": {
"Simtabi\\Laranail\\GitCommitChecker\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Simtabi\\Laranail\\GitCommitChecker\\Tests\\": "tests"
}
},
"require": {
"php": ">=8.0",
"laravel/framework": ">=9.32",
"laravel/pint": ">=1.4.0"
},
"require-dev": {
"phpunit/phpunit": ">=9.0"
},
"extra": {
"laravel": {
"providers": [
"Simtabi\\Laranail\\GitCommitChecker\\Providers\\GitCommitCheckerServiceProvider"
]
}
},

"config": {
"sort-packages": true
},
"minimum-stability": "stable"
"autoload-dev": {
"psr-4": {
"Simtabi\\Laranail\\GitCommitChecker\\Tests\\": "tests/"
}
},
"require": {
"php": "^8.4.1 || ^8.5",
"illuminate/console": "^13.0",
"illuminate/support": "^13.0"
},
"require-dev": {
"laravel/pint": "^1.18",
"orchestra/testbench": "^11.1",
"pestphp/pest": "^4.6"
},
"extra": {
"laravel": {
"providers": [
"Simtabi\\Laranail\\GitCommitChecker\\Providers\\GitCommitCheckerServiceProvider"
]
},
"branch-alias": {
"dev-main": "0.1.x-dev"
}
},
"config": {
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true
}
},
"minimum-stability": "stable",
"support": {
"issues": "https://github.com/laranail/git-commit-checker/issues",
"source": "https://github.com/laranail/git-commit-checker",
"docs": "https://opensource.simtabi.com/documentation/laranail/git-commit-checker/"
},
"prefer-stable": true
}
42 changes: 42 additions & 0 deletions docs/architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Architecture

What this package registers, and the names it claims.

## Public names

Laravel keeps view namespaces and config keys in **flat global maps**. A second package claiming a
key does not collide loudly — it silently replaces the first, and the failure surfaces far away as a
missing view or the wrong config value. A bare slug like `git-commit-checker` is a plausible collision with a
sibling package, a third-party one, or the consuming application's own.

| Surface | Name |
|---|---|
| Config key | `laranail.git-commit-checker` |
| View namespace | `laranail/git-commit-checker` |
| Publish tags | `laranail::git-commit-checker-*` |

Views take the slash form because Laravel interpolates the namespace into the override path, so a
published override lands in `resources/views/vendor/laranail/git-commit-checker` — one directory per vendor
rather than thirty siblings flat in the `vendor` root.

**This package previously claimed the bare `git-commit-checker` for both the config key and the view namespace.**
Its publish tags were already vendor-scoped, which is what made the gap easy to miss by eye: two of
the four names were right.

`tests/Feature/NamingConventionTest.php` asserts this against the **live registries** —
`View::getFinder()->getHints()` and the config repository — rather than by grepping the provider, so
the guard survives a refactor of the registration code.

## Modernisation

This package predates the family conventions. Adopting it moved:

- PHP `>=8.0` → `^8.4.1 || ^8.5`, the family floor.
- `laravel/framework >=9.x` → the individual `illuminate/*` components it actually uses. A package
should not require the whole framework.
- `laravel/pint` out of `require` and into `require-dev`. It is a dev tool, and requiring it forced
it into every consuming application.

---

[← Docs index](../README.md#documentation)
Binary file removed src/.DS_Store
Binary file not shown.
Loading