Skip to content

pre-commit hook task fix #444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,15 @@ tasks.withType<KorroTask> {
val installGitPreCommitHook by tasks.creating(Copy::class) {
doNotTrackState(/* reasonNotToTrackState = */ "Fails on TeamCity otherwise.")

from(File(rootProject.rootDir, "gradle/scripts/pre-commit"))
into(File(rootProject.rootDir, ".git/hooks"))
fileMode = 755
val gitHooksDir = File(rootProject.rootDir, ".git/hooks")
if (gitHooksDir.exists()) {
from(File(rootProject.rootDir, "gradle/scripts/pre-commit"))
into(gitHooksDir)
fileMode = 755
} else {
logger.lifecycle("'.git/hooks' directory not found. Skipping installation of pre-commit hook.")
}

}
tasks.named("assemble") {
dependsOn(installGitPreCommitHook)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ object PluginCallbackProxy : PluginCallback {
body =
"""
<details>
<summary>${expressions.joinToSource()
<summary>${expressions.joinToString(".") { it.source }
.also {
if (it.length > 95) TODO("expression is too long ${it.length}. better to split sample in multiple snippets")
}
Expand Down