From 091616c5a9cad73edd3014b9f762f71e4883e888 Mon Sep 17 00:00:00 2001 From: Jan Wennrich <jan.wennrich@pcsg.de> Date: Fri, 24 May 2024 17:07:39 +0200 Subject: [PATCH] chore: setup CaptainHook for project tooling --- .phive/phars.xml | 1 + captainhook.json | 16 ++++++++++++++++ tests/captainhook-bootstrap.php | 3 +++ 3 files changed, 20 insertions(+) create mode 100644 captainhook.json create mode 100644 tests/captainhook-bootstrap.php diff --git a/.phive/phars.xml b/.phive/phars.xml index 3c7dea3..63a030f 100644 --- a/.phive/phars.xml +++ b/.phive/phars.xml @@ -4,4 +4,5 @@ <phar name="phpunit" version="^10.5.20" installed="10.5.20" location="./tools/phpunit" copy="false"/> <phar name="phpcs" version="^3.10.1" installed="3.10.1" location="./tools/phpcs" copy="false"/> <phar name="phpcbf" version="^3.10.1" installed="3.10.1" location="./tools/phpcbf" copy="false"/> + <phar name="captainhook" version="^5.23.0" installed="5.23.0" location="./tools/captainhook" copy="false"/> </phive> diff --git a/captainhook.json b/captainhook.json new file mode 100644 index 0000000..30f1064 --- /dev/null +++ b/captainhook.json @@ -0,0 +1,16 @@ +{ + "config": { + "bootstrap": "tests/captainhook-bootstrap.php" + }, + "pre-commit": { + "enabled": true, + "actions": [ + { + "action": "\\CaptainHook\\App\\Hook\\PHP\\Action\\Linting" + }, + { + "action": "composer test" + } + ] + } +} \ No newline at end of file diff --git a/tests/captainhook-bootstrap.php b/tests/captainhook-bootstrap.php new file mode 100644 index 0000000..1b61b73 --- /dev/null +++ b/tests/captainhook-bootstrap.php @@ -0,0 +1,3 @@ +<?php + +// This file is supposed to be empty, see https://github.com/captainhookphp/captainhook/issues/248 -- GitLab