From 0b96bd5933a457a990a895cc47ddffee72c3f56c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Johansen?= Date: Mon, 4 Dec 2017 16:40:45 +0000 Subject: [PATCH 1/3] Fix the path to the pre-commit script in setup.sh --- src/setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/setup.sh b/src/setup.sh index fbcd6da..61cc911 100644 --- a/src/setup.sh +++ b/src/setup.sh @@ -7,7 +7,7 @@ else PRE_COMMIT_EXISTS=0 fi -cp ./vendor/smgladkovskiy/phpcs-git-pre-commit/src/pre-commit .git/hooks/pre-commit +cp ./vendor/wickedreports/phpcs-git-pre-commit/src/pre-commit .git/hooks/pre-commit chmod +x .git/hooks/pre-commit if [ "$PRE_COMMIT_EXISTS" = 0 ]; @@ -15,4 +15,4 @@ then echo "Pre-commit git hook is installed!" else echo "Pre-commit git hook is updated!" -fi \ No newline at end of file +fi From a02ad3b70dc36eec6cbe3860d109819cf4bcb280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Johansen?= Date: Mon, 4 Dec 2017 16:44:13 +0000 Subject: [PATCH 2/3] =?UTF-8?q?Create=20the=20hooks=20dir=20if=20it=20does?= =?UTF-8?q?n=E2=80=99t=20exists?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/setup.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/setup.sh b/src/setup.sh index 61cc911..77bc3da 100644 --- a/src/setup.sh +++ b/src/setup.sh @@ -7,6 +7,10 @@ else PRE_COMMIT_EXISTS=0 fi +if [ ! -d .git/hooks ]; then + mkdir -p .git/hooks +fi + cp ./vendor/wickedreports/phpcs-git-pre-commit/src/pre-commit .git/hooks/pre-commit chmod +x .git/hooks/pre-commit From 56ad434a235c9478e440519b3063b5995ee91d46 Mon Sep 17 00:00:00 2001 From: Stan Date: Fri, 15 Dec 2017 18:27:22 +0200 Subject: [PATCH 3/3] Kudos for the original developers --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d951dfd..c1620b1 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -# PHPCS git pre-commit hook +# Universal PHPCS git pre-commit hook ## About Auto installed git pre-commit hook for running [PHP Code Sniffer](https://github.com/squizlabs/PHP_CodeSniffer) code checking to PSR2 coding standard compliance. It checks only files that are to be committed. -Inspired by [Enforce code standards with composer, git hooks, and phpcs](http://tech.zumba.com/2014/04/14/control-code-quality/) +Inspired by [Enforce code standards with composer, git hooks, and phpcs](http://tech.zumba.com/2014/04/14/control-code-quality/) and https://github.com/smgladkovskiy/phpcs-git-pre-commit and https://gist.github.com/BrizzleRocker/62ed61b37acf05344d4bce894e719251 . Installer checks OS on hosting machine and installs needed hooks for platform. ## Installation