-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcaptainhook.json
More file actions
118 lines (117 loc) · 3.6 KB
/
captainhook.json
File metadata and controls
118 lines (117 loc) · 3.6 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
{
"config": {
"verbosity": "normal",
"fail-on-first-error": false,
"ansi-colors": true,
"git-directory": ".git",
"includes": [],
"run-async": false,
"custom": {
"this-is-truthy": "yes",
"this-is-falsy": "false"
}
},
"hooks": {
"commit-msg": {
"actions": [
{
"run": "CaptainHook::Message.MustFollowBeamsRules",
"options": {
"subject-length": 50,
"body-line-length": 72
}
},
{
"run": "CaptainHook::Message.MustContainsRegex",
"options": {
"regex": ".*"
}
},
{
"run": "echo arg-value+{$MESSAGE_FILE}+{$ARG|value-of:MESSAGE_FILE}+{$ARG|value-of:message-file}+"
}
]
},
"pre-push": {
"actions": [
{
"run": "CaptainHook::Branch.PreventPushOfFixupAndSquashCommits"
}
]
},
"pre-commit": {
"actions": [
{
"run": "echo foo",
"conditions": [
{
"run": "CaptainHook::InConfig.CustomValueIsTruthy",
"options": {
"value": "this-is-truthy"
}
},
{
"run": "CaptainHook::InConfig.CustomValueIsFalsy",
"options": {
"value": "this-is-falsy"
}
}
]
},
{
"run": "CaptainHook::File.DoesNotContainRegex",
"options": {
"regex": "fooooooo"
}
},
{
"run": "CaptainHook::File.MaxSize",
"config": {
"label": "Max Size 2MB"
},
"options": {
"max-size": "2M"
}
},
{
"run": "echo {$STAGED_FILES|of-type:go|separated-by:,|in-directory:exec}",
"conditions": [
{
"run": "CaptainHook::FileStaged.ThatIs",
"options": {
"of-type": "go",
"in-directory": "exec"
}
}
]
}
]
},
"prepare-commit-msg": {
"actions": [
{
"run": "CaptainHook::Message.InjectIssueKeyFromBranch",
"options": {
"regex": "([A-Za-z]+\\-[0-9]+)"
}
},
{
"run": "CaptainHook::Message.PrepareFromFile",
"options": {
"file": "foo.txt"
}
}
]
},
"post-change": {
"actions": [
{
"run": "CaptainHook::Debug.Success"
},
{
"run": "CaptainHook::Notify.GitNotify"
}
]
}
}
}