static-php-cli/captainhook.json

45 lines
1.3 KiB
JSON
Raw Normal View History

2025-12-10 13:41:36 +08:00
{
"pre-push": {
"enabled": true,
"actions": [
{
"action": "php vendor/bin/phpstan analyse --memory-limit 300M"
2025-12-10 13:41:36 +08:00
}
]
},
"pre-commit": {
"enabled": true,
"actions": [
{
"action": "php vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --dry-run --diff {$STAGED_FILES|of-type:php} --sequential",
2025-12-10 13:41:36 +08:00
"conditions": [
{
"exec": "\\CaptainHook\\App\\Hook\\Condition\\FileStaged\\OfType",
"args": ["php"]
}
]
}
]
},
"post-change": {
"enabled": true,
"actions": [
{
"action": "composer install",
"options": [],
"conditions": [
{
"exec": "\\CaptainHook\\App\\Hook\\Condition\\FileChanged\\Any",
"args": [
[
"composer.json",
"composer.lock"
]
]
}
]
}
]
}
}