Skip to content

Commit

Permalink
chore(readme): integrate results of the discussion in #118
Browse files Browse the repository at this point in the history
  • Loading branch information
DanySK authored Jul 11, 2022
1 parent ad7794a commit 2cfd4f6
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ the hooks are generated automatically.
## Usage

This plugin must be applied to `settings.gradle.kts`.
Groovy syntax not supported.

```kotlin
plugins {
Expand All @@ -22,6 +21,32 @@ gitHooks {
}
```

The Groovy syntax is not officially supported.
However, since Groovy can call Kotlin, it is still possible
(though pretty cumbersome)
to use the plugin from a Groovy `settings.gradle` file:

```groovy
plugins {
id('org.danilopianini.gradle-pre-commit-git-hooks') version '<version>'
}
gitHooks { extension ->
extension.with {
commitMsg { context ->
context.with {
conventionalCommits { conventionalCommits ->
conventionalCommits.with {
defaultTypes()
}
}
}
}
createHooks(true)
}
}
```

### Contexts

The plugin has special support for `commit-msg` and `pre-commit` hooks, which are the ones most frequently used.
Expand Down

0 comments on commit 2cfd4f6

Please sign in to comment.