mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-23 08:35:35 +08:00
switch hook to captainhook (#218)
This commit is contained in:
47
captainhook.json
Normal file
47
captainhook.json
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
{
|
||||||
|
"pre-push": {
|
||||||
|
"enabled": true,
|
||||||
|
"actions": [
|
||||||
|
{
|
||||||
|
"action": "composer analyse"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"action": "composer test"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"pre-commit": {
|
||||||
|
"enabled": true,
|
||||||
|
"actions": [
|
||||||
|
{
|
||||||
|
"action": "composer cs-fix -- {$STAGED_FILES|of-type:php} --dry-run",
|
||||||
|
"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"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
"dragonmantank/cron-expression": "^3.3",
|
"dragonmantank/cron-expression": "^3.3",
|
||||||
"jelix/version": "^2.0",
|
"jelix/version": "^2.0",
|
||||||
"koriym/attributes": "^1.0",
|
"koriym/attributes": "^1.0",
|
||||||
|
"nunomaduro/collision": "^6.3",
|
||||||
"onebot/libonebot": "^0.5",
|
"onebot/libonebot": "^0.5",
|
||||||
"php-di/php-di": "^7",
|
"php-di/php-di": "^7",
|
||||||
"psr/container": "^2.0",
|
"psr/container": "^2.0",
|
||||||
@@ -30,7 +31,7 @@
|
|||||||
"symfony/routing": "~6.0 || ~5.0 || ~4.0"
|
"symfony/routing": "~6.0 || ~5.0 || ~4.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"brainmaestro/composer-git-hooks": "^3.0",
|
"captainhook/captainhook": "^5.12",
|
||||||
"friendsofphp/php-cs-fixer": "^3.2 != 3.7.0",
|
"friendsofphp/php-cs-fixer": "^3.2 != 3.7.0",
|
||||||
"jangregor/phpstan-prophecy": "^1.0",
|
"jangregor/phpstan-prophecy": "^1.0",
|
||||||
"jetbrains/phpstorm-attributes": "^1.0",
|
"jetbrains/phpstorm-attributes": "^1.0",
|
||||||
@@ -84,17 +85,6 @@
|
|||||||
"sort-packages": true
|
"sort-packages": true
|
||||||
},
|
},
|
||||||
"extra": {
|
"extra": {
|
||||||
"hooks": {
|
|
||||||
"post-merge": "composer install",
|
|
||||||
"pre-commit": [
|
|
||||||
"echo committing as $(git config user.name)",
|
|
||||||
"composer cs-fix -- --diff"
|
|
||||||
],
|
|
||||||
"pre-push": [
|
|
||||||
"composer cs-fix -- --dry-run --diff",
|
|
||||||
"composer analyse"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"zm": {
|
"zm": {
|
||||||
"exclude-annotation-path": [
|
"exclude-annotation-path": [
|
||||||
"src/ZM",
|
"src/ZM",
|
||||||
@@ -103,11 +93,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"post-install-cmd": [
|
"post-autoload-dump": "vendor/bin/captainhook install -f -s",
|
||||||
"[ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/cghooks add"
|
|
||||||
],
|
|
||||||
"analyse": "phpstan analyse --memory-limit 300M",
|
"analyse": "phpstan analyse --memory-limit 300M",
|
||||||
"cs-fix": "php-cs-fixer fix",
|
"cs-fix": "PHP_CS_FIXER_FUTURE_MODE=1 php-cs-fixer fix",
|
||||||
"test": "bin/phpunit-zm --no-coverage"
|
"test": "bin/phpunit-zm --no-coverage"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user