GitHooksExtension

open class GitHooksExtension(repoRoot: File) : Serializable

DSL entry point, to be applied to settings.gradle.kts.

Constructors

Link copied to clipboard
constructor(repoRoot: File)
constructor(settings: Settings)

Properties

Link copied to clipboard

The git repository root. If unset, it will be searched recursively from the project root towards the filesystem root.

Functions

Link copied to clipboard
fun commitMsg(configuration: CommitMsgScriptContext.() -> Unit)

Commit-msg hook.

Link copied to clipboard
fun createHooks(overwriteExisting: Boolean = false)

To be called to force the hook creation in case of necessity. If passed true, overwrites in case the script is already present and different than expected.

Link copied to clipboard
fun hook(hookName: String, configuration: ScriptContext.() -> Unit)

Defines a new hook with an arbitrary name.

Link copied to clipboard
fun preCommit(configuration: ScriptContext.() -> Unit)

Pre-commit hook.