Skip to content

Commit

Permalink
test: update git hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
ramsey committed Jun 23, 2021
1 parent c706044 commit 60d008a
Showing 1 changed file with 45 additions and 21 deletions.
66 changes: 45 additions & 21 deletions captainhook.json
@@ -1,7 +1,4 @@
{
"config": {
"verbosity": "normal"
},
"commit-msg": {
"enabled": true,
"actions": [
Expand All @@ -11,28 +8,63 @@
]
},
"pre-push": {
"enabled": false,
"actions": []
"enabled": true,
"actions": [
{
"action": "composer test"
}
]
},
"pre-commit": {
"enabled": true,
"actions": [
{
"action": "composer normalize --indent-size=4 --indent-style=space --ansi",
"action": "composer validate",
"conditions": [
{
"exec": "\\CaptainHook\\App\\Hook\\Condition\\FileStaged\\Any",
"args": [
["composer.json"]
]
"args": [["composer.json"]]
}
]
},
{
"action": "composer normalize --dry-run",
"conditions": [
{
"exec": "\\CaptainHook\\App\\Hook\\Condition\\FileStaged\\Any",
"args": [["composer.json"]]
}
]
},
{
"action": "composer devtools lint:pds"
},
{
"action": "composer devtools lint:syntax -- -- {$STAGED_FILES|of-type:php}",
"conditions": [
{
"exec": "\\CaptainHook\\App\\Hook\\Condition\\FileStaged\\OfType",
"args": ["php"]
}
]
},
{
"action": "composer pre-commit {$STAGED_FILES|of-type:php}"
"action": "composer devtools lint:style -- -- {$STAGED_FILES|of-type:php}",
"conditions": [
{
"exec": "\\CaptainHook\\App\\Hook\\Condition\\FileStaged\\OfType",
"args": ["php"]
}
]
},
{
"action": "git add {$STAGED_FILES}"
"action": "composer devtools analyze -- -- {$STAGED_FILES|of-type:php}",
"conditions": [
{
"exec": "\\CaptainHook\\App\\Hook\\Condition\\FileStaged\\OfType",
"args": ["php"]
}
]
}
]
},
Expand All @@ -44,10 +76,6 @@
}
]
},
"post-commit": {
"enabled": false,
"actions": []
},
"post-merge": {
"enabled": true,
"actions": [
Expand All @@ -56,9 +84,7 @@
"conditions": [
{
"exec": "\\CaptainHook\\App\\Hook\\Condition\\FileChanged\\Any",
"args": [
["composer.json", "composer.lock"]
]
"args": [["composer.json", "composer.lock"]]
}
]
}
Expand All @@ -72,9 +98,7 @@
"conditions": [
{
"exec": "\\CaptainHook\\App\\Hook\\Condition\\FileChanged\\Any",
"args": [
["composer.json", "composer.lock"]
]
"args": [["composer.json", "composer.lock"]]
}
]
}
Expand Down

0 comments on commit 60d008a

Please sign in to comment.