The Captain's favorite hooks
Here ye can find a treasure full with the Captain's favorite hooks ready for ye to get copy and pasted into yer own captainhook.json files.
Commit message validation
"commit-msg": {
"actions": [
{
"run": "CaptainHook::Message.MustFollowBeamsRules",
"options": {
"subject-length": 50,
"body-line-length": 72
}
}
]
}
Soft quality checks on commit
"pre-commit": {
"actions": [
{
"run": "cs-style-check {$STAGED_FILES|of-type:go|separated-by: }",
"conditions": [
{
"run": "CaptainHook::FileStaged.ThatIs",
"options": {"of-type": "go"]
}
]
}
]
}
Hard quality checks on push
"pre-push": {
"actions": [
{
"run": "go test"
}
]
}
Convenience hooks
"post-change": {
"enabled": true,
"actions": [
{
"action": "go mod -u",
"conditions": [
{
"run": "CaptainHook::FileChanged.Any",
"options": {
"files": ["go.mod", "go.sum"]
}
}
]
}
]
}