From 1dabd28f0071bff3e5e77e071c117f9df4cd6a92 Mon Sep 17 00:00:00 2001 From: Piotr Kubowicz Date: Tue, 4 Nov 2025 18:21:30 +0100 Subject: [PATCH] Disable Configuration Cache in generated pre-commit Gradle call internalKtlintGitFilter is part of the cache key, and it changes with every commit, so getting a cache hit is extremely unlikely. --- CHANGELOG.md | 1 + plugin/src/main/kotlin/org/jlleitschuh/gradle/ktlint/GitHook.kt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cfcb08566..e3e6b8b8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +- Disable Configuration Cache in generated pre-commit Gradle call [#995](https://github.com/JLLeitschuh/ktlint-gradle/pull/995) - Update build to work with gradle 9.1 and Java 25 [#962](https://github.com/JLLeitschuh/ktlint-gradle/pull/962) - Collapse sourcesets to simply build [#964](https://github.com/JLLeitschuh/ktlint-gradle/pull/964) diff --git a/plugin/src/main/kotlin/org/jlleitschuh/gradle/ktlint/GitHook.kt b/plugin/src/main/kotlin/org/jlleitschuh/gradle/ktlint/GitHook.kt index 4b4368b1e..4c2d50c82 100644 --- a/plugin/src/main/kotlin/org/jlleitschuh/gradle/ktlint/GitHook.kt +++ b/plugin/src/main/kotlin/org/jlleitschuh/gradle/ktlint/GitHook.kt @@ -36,7 +36,7 @@ private fun generateGradleCommand( } else { "./gradlew" } - return "$gradleCommand --quiet $taskName -P$FILTER_INCLUDE_PROPERTY_NAME=\"${'$'}CHANGED_FILES\"" + return "$gradleCommand --quiet --no-configuration-cache $taskName -P$FILTER_INCLUDE_PROPERTY_NAME=\"${'$'}CHANGED_FILES\"" } private fun generateGitCommand(