Skip to content

Commit

Permalink
build: remove precommit git hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
SettingDust committed Aug 9, 2024
1 parent 4ff73d5 commit da125fa
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -65,35 +65,6 @@ dependencyResolutionManagement.versionCatalogs.named("catalog") {
plugins {
// https://plugins.gradle.org/plugin/org.gradle.toolchains.foojay-resolver-convention
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
// https://github.com/DanySK/gradle-pre-commit-git-hooks
id("org.danilopianini.gradle-pre-commit-git-hooks") version "2.0.4"
}

gitHooks {
preCommit {
from {
// git diff --cached --name-only --diff-filter=ACMR | while read -r a; do
// echo ${'$'}(readlink -f ${"$"}a); ./gradlew spotlessApply -q
// -PspotlessIdeHook="${'$'}(readlink -f ${"$"}a)" </dev/null; done
"""
export JAVA_HOME="${System.getProperty("java.home")}"
./gradlew spotlessApply spotlessCheck
"""
.trimIndent()
}
}
commitMsg { conventionalCommits { defaultTypes() } }
hook("post-commit") {
from {
"""
files="${'$'}(git show --pretty= --name-only | tr '\n' ' ')"
git add ${'$'}files
git -c core.hooksPath= commit --amend -C HEAD
"""
.trimIndent()
}
}
createHooks(true)
}

val name: String by settings
Expand Down

0 comments on commit da125fa

Please sign in to comment.