Skip to content

Commit f3e95b5

Browse files
authored
Merge pull request #593 from code16/pint-hook
Setup pint pre-commit hook
2 parents 8089458 + 2f59b54 commit f3e95b5

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@
5959
},
6060
"scripts": {
6161
"test": "vendor/bin/testbench package:test --parallel",
62-
"typescript:generate": "php demo/artisan ziggy:generate --types-only; php demo/artisan typescript:transform"
62+
"typescript:generate": "php demo/artisan ziggy:generate --types-only; php demo/artisan typescript:transform",
63+
"post-autoload-dump": [
64+
"git config core.hooksPath scripts/hooks"
65+
]
6366
},
6467
"extra": {
6568
"laravel": {

scripts/hooks/pre-commit

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
3+
files=$(git diff --cached --name-only --diff-filter=ACM -- '*.php');
4+
5+
if [ -n "$files" ]; then
6+
vendor/bin/pint $files
7+
git add $files
8+
fi

0 commit comments

Comments
 (0)