-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
captainhook.sample.json
97 lines (97 loc) · 2.78 KB
/
captainhook.sample.json
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
{
"config": {
"verbosity": "normal",
"fail-on-first-error": false,
"ansi-colors": true,
"git-directory": ".git",
"includes": [],
"run-path": "tools/captainhook",
"run-async": true,
"custom": {
"foo": "bar",
"fiz": "baz"
}
},
"hooks": {
"commit-msg": {
"actions": [
{
"run": "CaptainHook::Message.MustFollowBeamsRules",
"options": {
"subject-length": 50,
"body-line-length": 72
}
},
{
"run": "CaptainHook::Message.ContainsRegex",
"options": {
"regex": ".*"
}
}
]
},
"pre-push": {
"actions": [
{
"run": "CaptainHook::Branch.BlockFixupAndSquashCommits"
}
]
},
"pre-commit": {
"actions": [
{
"run": "CaptainHook::File.DoesNotContainRegex",
"options": {
"regex": "foooo"
}
},
{
"run": "CaptainHook::File.IsNotEmpty",
"options": {
"files": [
"some/file/that/cant/be/empty",
"other/file/that/cant/be/empty"
]
}
},
{
"run": "CaptainHook::File.MaxSize",
"config": {
"allow-failure": true
},
"options": {
"max-size": "1M"
}
},
{
"action": "echo \"{$STAGED_FILES|of-type:md|separated-by: }\"",
"conditions": [
{
"run": "CaptainHook::FileStaged.ThatIs",
"options": {
"of-type": "go"
}
}
]
}
]
},
"prepare-commit-msg": {
"actions": [
{
"run": "CaptainHook::Message.PrepareFromFile",
"options": {
"file": ".git/CH_COMMIT_MESSAGE.tmp"
}
}
]
},
"post-change": {
"actions": [
{
"run": "CaptainHook::Notify.GitNotify"
}
]
}
}
}