-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcaptainhook.json
More file actions
83 lines (83 loc) · 2.77 KB
/
captainhook.json
File metadata and controls
83 lines (83 loc) · 2.77 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
{
"$schema": "https://captainhookphp.github.io/captainhook/schema.json",
"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 for secrets...' && gitleaks protect --staged --verbose --redact --config=.gitleaks.toml",
"conditions": []
},
{
"action": "echo 'Running Pint style check...' && composer lint:pint",
"conditions": []
},
{
"action": "echo 'Running PHPCS structural checks...' && composer lint:phpcs",
"conditions": []
},
{
"action": "echo 'Running PHPStan static analysis...' && composer lint:phpstan",
"conditions": []
},
{
"action": "echo 'Running PHPMD...' && composer lint:phpmd",
"conditions": []
},
{
"action": "echo 'Running PHP-CS-Fixer...' && composer lint:cs",
"conditions": []
}
]
},
"pre-push": {
"enabled": true,
"actions": [
{
"action": "echo '🔒 Scanning commits for secrets...' && if ! command -v gitleaks >/dev/null 2>&1; then echo 'Note: install gitleaks: brew install gitleaks'; exit 0; fi; default_ref=$(git symbolic-ref --quiet refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/@@'); gitleaks detect --verbose --redact --config=.gitleaks.toml --log-opts=\"${default_ref:-origin/develop}..HEAD\"",
"conditions": []
},
{
"action": "echo 'Running tests...' && composer test",
"conditions": []
}
]
},
"post-merge": {
"enabled": false,
"actions": []
},
"post-checkout": {
"enabled": false,
"actions": []
},
"post-rewrite": {
"enabled": false,
"actions": []
},
"post-change": {
"enabled": false,
"actions": []
},
"prepare-commit-msg": {
"enabled": false,
"actions": []
}
}