Skip to content

Instantly share code, notes, and snippets.

View mzstic's full-sized avatar

Martin Patera mzstic

View GitHub Profile
@mzstic
mzstic / composer.json
Created October 31, 2017 09:51
Post update + pos install code check
"scripts": {
"post-update-cmd": [
"[ -d .git ] && cp pre-commit-check.sh .git/hooks/pre-commit; exit 0;"
],
"post-install-cmd": [
"[ -d .git ] && cp pre-commit-check.sh .git/hooks/pre-commit; exit 0;"
]
}
@mzstic
mzstic / pre-commit-check.sh
Created October 31, 2017 09:45
Code check only on commited files
#!/bin/bash
# Installation
# ------------
# Use following command
# cp pre-commit.sh .git/hooks/pre-commit
# It is done automatically after composer install / update
PHPCS_BIN=vendor/bin/phpcs
TMP_STAGING=".tmp_staging"
# comma-separated list of file patterns being ignored