Skip to content

Commit 85e2df6

Browse files
committed
Merge branch 'indy2kro/master' into feature/docker-support-and-auto-fix-config
# Conflicts: # .scrutinizer.yml # composer.json
2 parents 5882893 + 6498171 commit 85e2df6

File tree

13 files changed

+846
-564
lines changed

13 files changed

+846
-564
lines changed

.github/workflows/main.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,20 @@ permissions:
1919
contents: read
2020

2121
jobs:
22-
laravel10-tests:
22+
laravel11-tests:
2323
runs-on: ubuntu-latest
2424

2525
strategy:
26+
fail-fast: false
2627
matrix:
2728
operating-system: [ ubuntu-latest ]
28-
php: [ '8.1', '8.2' ]
29+
php: [ '8.2', '8.3', '8.4' ]
2930
dependency-stability: [ 'prefer-stable' ]
3031

31-
laravel: [ '10.*' ]
32+
laravel: [ '11.*' ]
3233
include:
33-
- laravel: 10.*
34-
testbench: 8.*
34+
- laravel: 11.*
35+
testbench: 9.*
3536

3637
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.dependency-stability }} - ${{ matrix.operating-system}}
3738

@@ -70,16 +71,16 @@ jobs:
7071
id: actions-cache
7172
with:
7273
path: ${{ steps.composer-cache.outputs.dir }}
73-
key: ${{ runner.os }}-composer-laravel-10-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
74+
key: ${{ runner.os }}-composer-laravel-11-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
7475
restore-keys: |
75-
${{ runner.os }}-composer-laravel-10-${{ matrix.php }}-
76+
${{ runner.os }}-composer-laravel-11-${{ matrix.php }}-
7677
7778
- name: Cache PHP dependencies (vendor)
7879
uses: actions/cache@v4
7980
id: vendor-cache
8081
with:
8182
path: vendor
82-
key: ${{ runner.os }}-build-laravel-10-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
83+
key: ${{ runner.os }}-build-laravel-11-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
8384

8485
- name: Install Laravel Dependencies
8586
if: steps.vendor-cache.outputs.cache-hit != 'true'
@@ -120,20 +121,21 @@ jobs:
120121
run: vendor/bin/rector --dry-run
121122

122123
- name: Execute PHP Insights
123-
run: vendor/bin/phpinsights --no-interaction
124+
run: vendor/bin/phpinsights --disable-security-check --no-interaction
124125

125-
laravel11-tests:
126+
laravel12-tests:
126127
runs-on: ubuntu-latest
127128

128129
strategy:
130+
fail-fast: false
129131
matrix:
130132
operating-system: [ ubuntu-latest ]
131133
php: [ '8.2', '8.3', '8.4' ]
132134
dependency-stability: [ 'prefer-stable' ]
133135

134-
laravel: [ '11.*' ]
136+
laravel: [ '12.*' ]
135137
include:
136-
- laravel: 11.*
138+
- laravel: 12.*
137139
testbench: 9.*
138140

139141
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.dependency-stability }} - ${{ matrix.operating-system}}
@@ -223,5 +225,4 @@ jobs:
223225
run: vendor/bin/rector --dry-run
224226

225227
- name: Execute PHP Insights
226-
run: vendor/bin/phpinsights --no-interaction
227-
228+
run: vendor/bin/phpinsights --disable-security-check --no-interaction

README.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
<p align="center">A powerful and easy-to-use package for managing Git hooks within your Laravel projects. Improve your code quality, reduce the time spent on code reviews, and catch potential bugs before they make it into your repository.</p>
44

55
<p align="center">
6-
<a href="https://packagist.org/packages/igorsgm/laravel-git-hooks">
7-
<img src="https://img.shields.io/packagist/v/igorsgm/laravel-git-hooks.svg?style=flat-square" alt="Latest Version on Packagist">
6+
<a href="https://packagist.org/packages/indy2kro/laravel-git-hooks">
7+
<img src="https://img.shields.io/packagist/v/indy2kro/laravel-git-hooks.svg?style=flat-square" alt="Latest Version on Packagist">
88
</a>
9-
<a href="https://github.com/igorsgm/laravel-git-hooks/actions/workflows/main.yml/badge.svg">
10-
<img src="https://img.shields.io/github/actions/workflow/status/igorsgm/laravel-git-hooks/main.yml?style=flat-square" alt="Build Status">
9+
<a href="https://github.com/indy2kro/laravel-git-hooks/actions/workflows/main.yml/badge.svg">
10+
<img src="https://img.shields.io/github/actions/workflow/status/indy2kro/laravel-git-hooks/main.yml?style=flat-square" alt="Build Status">
1111
</a>
12-
<img src="https://img.shields.io/scrutinizer/coverage/g/igorsgm/laravel-git-hooks/master?style=flat-square" alt="Test Coverage">
13-
<img src="https://img.shields.io/scrutinizer/quality/g/igorsgm/laravel-git-hooks/master?style=flat-square" alt="Code Quality">
14-
<a href="https://packagist.org/packages/igorsgm/laravel-git-hooks">
15-
<img src="https://img.shields.io/packagist/dt/igorsgm/laravel-git-hooks.svg?style=flat-square" alt="Total Downloads">
12+
<img src="https://img.shields.io/scrutinizer/coverage/g/indy2kro/laravel-git-hooks/master?style=flat-square" alt="Test Coverage">
13+
<img src="https://img.shields.io/scrutinizer/quality/g/indy2kro/laravel-git-hooks/master?style=flat-square" alt="Code Quality">
14+
<a href="https://packagist.org/packages/indy2kro/laravel-git-hooks">
15+
<img src="https://img.shields.io/packagist/dt/indy2kro/laravel-git-hooks.svg?style=flat-square" alt="Total Downloads">
1616
</a>
1717
</p>
1818

@@ -22,6 +22,8 @@
2222
<img src="https://user-images.githubusercontent.com/14129843/234191523-859b962d-bfdf-4df7-88da-9c80ddb93607.png" alt="Laravel Git Hooks usage sample">
2323
</p>
2424

25+
This is a fork of <a href="https://github.com/igorsgm/laravel-git-hooks">igorsgm/laravel-git-hooks</a> maintained for latest versions.
26+
2527
## ✨ Features
2628

2729
- **Pre-configured Hooks:** Laravel Git Hooks comes with pre-configured pre-commit hooks for popular tools, such as Laravel Pint, PHPCS, ESLint, Prettier, Larastan, Enlightn, Rector, PHP Insights and Blade Formatter, making it easy to enforce coding standards and style guidelines right away.
@@ -36,7 +38,7 @@
3638

3739
- You can install the package via composer:
3840
```bash
39-
composer require igorsgm/laravel-git-hooks --dev
41+
composer require indy2kro/laravel-git-hooks --dev
4042
```
4143

4244
- Publish the config file and customize it in the way you want:
@@ -58,6 +60,7 @@ To use the already created pre-commit hooks of this package, you can simply edit
5860
'pre-commit' => [
5961
\Igorsgm\GitHooks\Console\Commands\Hooks\PintPreCommitHook::class, // Laravel Pint
6062
\Igorsgm\GitHooks\Console\Commands\Hooks\PHPCodeSnifferPreCommitHook::class, // PHPCS (with PHPCBF autofixer)
63+
\Igorsgm\GitHooks\Console\Commands\Hooks\PHPCSFixerPreCommitHook::class, // PHP CS Fixer
6164
\Igorsgm\GitHooks\Console\Commands\Hooks\LarastanPreCommitHook::class, // Larastan
6265
\Igorsgm\GitHooks\Console\Commands\Hooks\EnlightnPreCommitHook::class, // Enlightn
6366
\Igorsgm\GitHooks\Console\Commands\Hooks\ESLintPreCommitHook::class, // ESLint
@@ -374,6 +377,10 @@ Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
374377
375378
## Credits
376379
380+
- [Cristian Radu](https://github.com/indy2kro)
381+
382+
Original authors:
383+
377384
- [Igor Moraes](https://github.com/igorsgm)
378385
- [Pavel Buchnev](https://github.com/butschster)
379386

composer.json

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,25 @@
2121
}
2222
],
2323
"require": {
24-
"php": "^8.1",
25-
"illuminate/config": "^10.0|^11.0",
26-
"illuminate/console": "^10.0|^11.0",
27-
"illuminate/container": "^10.0|^11.0",
28-
"illuminate/contracts": "^10.0|^11.0",
29-
"illuminate/pipeline": "^10.0|^11.0",
30-
"illuminate/support": "^10.0|^11.0"
24+
"php": "^8.2",
25+
"illuminate/config": "^11.0|^12.0",
26+
"illuminate/console": "^11.0|^12.0",
27+
"illuminate/container": "^11.0|^12.0",
28+
"illuminate/contracts": "^11.0|^12.0",
29+
"illuminate/pipeline": "^11.0|^12.0",
30+
"illuminate/support": "^11.0|^12.0"
3131
},
3232
"require-dev": {
3333
"enlightn/enlightn": "^2.3",
34-
"larastan/larastan": "^2.9",
34+
"friendsofphp/php-cs-fixer": "^3.0",
35+
"larastan/larastan": "^2.0|^3.0",
3536
"laravel/pint": "^1.2",
3637
"mockery/mockery": "^1.6.1",
3738
"nunomaduro/phpinsights": "^2.12",
38-
"orchestra/testbench": "^v8.0.0|^v9.0.0",
39+
"orchestra/testbench": "^v8.0|^v9.0|^v10.0",
3940
"pestphp/pest": "^2.0|^3.0",
40-
"pestphp/pest-plugin-laravel": "^2.0 | ^3.0",
41-
"rector/rector": "^1.0 | ^2.0 | ^3.0",
41+
"pestphp/pest-plugin-laravel": "^2.0|^3.0",
42+
"rector/rector": "^1.0|^2.0|^3.0",
4243
"squizlabs/php_codesniffer": "^3.11.0"
4344
},
4445
"autoload": {

config/git-hooks.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,16 +184,23 @@
184184
'phpcbf_path' => env('PHPCBF_PATH', 'vendor/bin/phpcbf'),
185185
'config' => env('PHPCS_STANDARD_CONFIG', 'phpcs.xml'),
186186
'file_extensions' => env('PHPCS_FILE_EXTENSIONS', '/\.php$/'),
187-
'run_in_docker' => env('LARAVEL_PHPCS_RUN_IN_DOCKER', false),
188-
'docker_container' => env('LARAVEL_PHPCS_DOCKER_CONTAINER', ''),
187+
'run_in_docker' => env('PHPCS_RUN_IN_DOCKER', false),
188+
'docker_container' => env('PHPCS_DOCKER_CONTAINER', ''),
189+
],
190+
'php_cs_fixer' => [
191+
'path' => env('PHPCSFIXER_PATH', 'vendor/bin/php-cs-fixer'),
192+
'config' => env('PHPCSFIXER_STANDARD_CONFIG', '.php-cs-fixer.php'),
193+
'file_extensions' => env('PHPCSFIXER_FILE_EXTENSIONS', '/\.php$/'),
194+
'run_in_docker' => env('PHPCSFIXER_RUN_IN_DOCKER', false),
195+
'docker_container' => env('PHPCSFIXER_DOCKER_CONTAINER', ''),
189196
],
190197
'larastan' => [
191198
'path' => env('LARASTAN_PATH', 'vendor/bin/phpstan'),
192199
'config' => env('LARASTAN_CONFIG', 'phpstan.neon'),
193200
'additional_params' => env('LARASTAN_ADDITIONAL_PARAMS', '--xdebug'),
194201
'file_extensions' => env('LARASTAN_FILE_EXTENSIONS', '/\.php$/'),
195-
'run_in_docker' => env('LARAVEL_LARASTAN_RUN_IN_DOCKER', false),
196-
'docker_container' => env('LARAVEL_LARASTAN_DOCKER_CONTAINER', ''),
202+
'run_in_docker' => env('LARASTAN_RUN_IN_DOCKER', false),
203+
'docker_container' => env('LARASTAN_DOCKER_CONTAINER', ''),
197204
],
198205
'blade_formatter' => [
199206
'path' => env('BLADE_FORMATTER_PATH', 'node_modules/.bin/blade-formatter'),

0 commit comments

Comments
 (0)