https://github.com/absaoss/sbt-git-hooks
SBT plugin to sync git hooks as part of the project
https://github.com/absaoss/sbt-git-hooks
Last synced: 3 months ago
JSON representation
SBT plugin to sync git hooks as part of the project
- Host: GitHub
- URL: https://github.com/absaoss/sbt-git-hooks
- Owner: AbsaOSS
- License: apache-2.0
- Created: 2022-06-03T13:17:32.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-07-28T07:49:13.000Z (over 3 years ago)
- Last Synced: 2024-12-29T23:26:12.654Z (about 1 year ago)
- Language: Scala
- Size: 47.9 KB
- Stars: 1
- Watchers: 6
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# sbt-git-hooks
[](http://www.apache.org/licenses/LICENSE-2.0.html)
[](https://github.com/AbsaOSS/sbt-git-hooks/actions/workflows/release.yml)
sbt-git-hooks is an [sbt](http://www.scala-sbt.org) plugin for maintaining git hooks as part of your code.
Git hooks originally reside in `.git/hooks` which is not versioned as part of the code, but it is something you
want to share with other contributors to your code. This plugin syncs git hooks from your project folder with the ones
in the `.git/hooks` folder.
Sample files are ignored.
## Getting started
In order to add the sbt-git-hooks plugin to your build, add the following line to `project/plugins.sbt`:
``` sbt
addSbtPlugin("za.co.absa.sbt" % "sbt-git-hooks" % "X.Y.Z")
```
Then, optionally, in your `build.sbt` configure the following settings:
```sbt
overwriteGitHookFiles := true
gitHookFilesLocation := "project/git_hooks"
```
- `overwriteGitHookFiles` setting allows you to overwrite the files already present in `.git/hooks`. Defaults to `false`
- `gitHookFilesLocation` setting allows you to set a different folder for source of hook files. This is relative to the project. Defaults to `project/git_hooks`
### Syncing hook files
To run a sync use `sbt syncGitHooks`.
### Checking what files would get synced if any
To check which files would get synced and what would happen run `sbt getGitHooksToSync`
### Requirements
- Java 8 or higher
- sbt 1.3.0 or higher
## How to Release
Please see [this file](RELEASE.md) for more details.