-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcaptainhook.json
More file actions
52 lines (52 loc) · 1.78 KB
/
captainhook.json
File metadata and controls
52 lines (52 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{
"$schema": "https://captainhookphp.github.io/captainhook/schema.json",
"config": {
"run-mode": "php"
},
"commit-msg": {
"enabled": true,
"actions": [
{
"action": "\\CaptainHook\\App\\Hook\\Message\\Action\\Regex",
"options": {
"regex": "/^(feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert)(\\(.+\\))?!?:\\s.{1,100}$/",
"error": "Commit message must follow Conventional Commits format: <type>(<scope>): <description>"
}
}
]
},
"pre-commit": {
"enabled": true,
"actions": [
{
"action": "\\CaptainHook\\App\\Hook\\PHP\\Action\\Linting",
"options": {
"extensions": "php"
}
},
{
"action": "echo 'Scanning staged changes for secrets...' && gitleaks protect --staged --verbose --redact --config=.gitleaks.toml"
},
{
"action": "echo 'Running Pint...' && composer lint:pint"
},
{
"action": "echo 'Running PHPCS...' && composer lint:phpcs"
},
{
"action": "echo 'Running PHPStan...' && composer lint:phpstan"
}
]
},
"pre-push": {
"enabled": true,
"actions": [
{
"action": "echo 'Scanning unpushed commits for secrets...' && gitleaks detect --verbose --redact --config=.gitleaks.toml --log-opts=\"origin/main..HEAD\" || echo 'Note: install gitleaks locally to enable pre-push secret scans'"
},
{
"action": "echo 'Running tests...' && composer test"
}
]
}
}