Today you can hook into all of the following git-hooks:
let hookList = [
"applypatch-msg",
"pre-applypatch",
"post-applypatch",
"pre-commit",
"prepare-commit-msg",
"commit-msg",
"post-commit",
"pre-rebase",
"post-checkout",
"post-merge",
"pre-push",
"pre-receive",
"update",
"post-receive",
"post-update",
"push-to-checkout",
"pre-auto-gc",
"post-rewrite",
"sendemail-validate",
]
These are all keys you can use in the config setting:
#if canImport(PackageConfig)
import PackageConfig
let config = PackageConfiguration([
"komondor": [
"pre-commit": ["swift test", "swift run swiftFormat .", "git add ."],
"pre-push": ["swift test", "swift run danger-swift local", "swift run swiftlint"]
],
])
#endif
The values can be either a single string, or an array of strings. Each command is executed sequentially.