Skip to content

Commit

Permalink
add git hook
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielLiu1123 committed Nov 14, 2023
1 parent 45602b4 commit 3622472
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

./gradlew spotlessApply > /dev/null

git add -u
7 changes: 7 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,10 @@ allprojects {
omitVisitors.addAll('FindReturnRef', 'DoInsideDoPrivileged')
}
}

tasks.register('installGitHook', Copy) {
from "$rootProject.rootDir/.githooks"
into { new File(rootProject.rootDir, '.git/hooks') }
fileMode 0775
}
compileJava.dependsOn installGitHook

0 comments on commit 3622472

Please sign in to comment.