Skip to content

Commit 74043a0

Browse files
committed
ISSUE-345: add pre-commit hook
1 parent 8b07cb7 commit 74043a0

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

.husky/pre-commit

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
echo "🔍 Running PHPStan..."
5+
php vendor/bin/phpstan analyse -l 5 src/ tests/ || exit 1
6+
7+
echo "📏 Running PHPMD..."
8+
php vendor/bin/phpmd src/ text vendor/phplist/core/config/PHPMD/rules.xml || exit 1
9+
10+
echo "🧹 Running PHPCS..."
11+
php vendor/bin/phpcs --standard=vendor/phplist/core/config/PhpCodeSniffer/ src/ tests/ || exit 1

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"@babel/preset-env": "^7.27.2",
55
"@symfony/webpack-encore": "^5.1.0",
66
"babel-loader": "^10.0.0",
7+
"husky": "^9.1.7",
78
"vue-loader": "^17.3.1",
89
"vue-template-compiler": "^2.7.14",
910
"webpack": "^5.99.9",
@@ -12,5 +13,8 @@
1213
},
1314
"dependencies": {
1415
"vue": "3"
16+
},
17+
"scripts": {
18+
"prepare": "husky install"
1519
}
1620
}

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1860,6 +1860,11 @@ htmlparser2@^6.1.0:
18601860
domutils "^2.5.2"
18611861
entities "^2.0.0"
18621862

1863+
husky@^9.1.7:
1864+
version "9.1.7"
1865+
resolved "https://registry.yarnpkg.com/husky/-/husky-9.1.7.tgz#d46a38035d101b46a70456a850ff4201344c0b2d"
1866+
integrity sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==
1867+
18631868
icss-utils@^5.0.0, icss-utils@^5.1.0:
18641869
version "5.1.0"
18651870
resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-5.1.0.tgz#c6be6858abd013d768e98366ae47e25d5887b1ae"

0 commit comments

Comments
 (0)