From 5a9c27b1aaba6bb04791bd82efddb28a2b33f52c Mon Sep 17 00:00:00 2001 From: Damien Biasotto Date: Mon, 21 May 2018 14:57:37 +1000 Subject: [PATCH] Make hooks compatible with pre-commit latest version --- .pre-commit-hooks.yaml | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .pre-commit-hooks.yaml diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml new file mode 100644 index 0000000..48ef745 --- /dev/null +++ b/.pre-commit-hooks.yaml @@ -0,0 +1,42 @@ +- id: php-lint-all + name: PHP Syntax Check (Comprehensive) + description: Check PHP Syntax on ALL PHP staged files with user friendly messages and colors + entry: pre_commit_hooks/php-lint.sh + language: script + files: \.php$ + args: [-s all] + +- id: php-lint + name: PHP Syntax Check (Quick) + description: Runs php -l on all staged files. Exits when it hits the first errored file + entry: php -l + language: system + files: \.php$ + +- id: php-unit + name: PHP Unit + description: Run the full php unit test. Checks which PHPUnit executable is available first and then runs it. Preference order is vendor/bin, phpunit and phpunit.phar. + entry: pre_commit_hooks/php-unit.sh + language: script + files: \.php$ + +- id: php-cs + name: PHP Codesniffer + description: Run php codesniffer against all staged files. + entry: pre_commit_hooks/php-cs.sh + language: script + files: \.php$ + +- id: php-cbf + name: PHP Codesniffer (Code Beutifier and Formatter) + description: Run php codesniffer against all staged files. + entry: pre_commit_hooks/php-cbf.sh + language: script + files: \.php$ + +- id: php-cs-fixer + name: PHP Coding Standards Fixer + description: Run php coding standards fixer against all staged files. + entry: pre_commit_hooks/php-cs-fixer.sh + language: script + files: \.php$