diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 03fdaca0e6bcd..03c133543f332 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -47,9 +47,7 @@ jobs: with: gradle-home-cache-cleanup: true - name: Check for Detekt Issues - run: ./gradlew detekt - - name: Check for Detekt Issues with type resolution - run: ./gradlew detektMain detektTestFixtures detektTest detektFunTest + run: ./gradlew detektAll - name: Upload SARIF File uses: github/codeql-action/upload-sarif@4fa2a7953630fd2f3fb380f21be14ede0169dd4f # v3 if: always() # Upload even if the previous step failed. diff --git a/buildSrc/src/main/kotlin/ort-kotlin-conventions.gradle.kts b/buildSrc/src/main/kotlin/ort-kotlin-conventions.gradle.kts index 59bbb40d3126d..d0747cebcd712 100644 --- a/buildSrc/src/main/kotlin/ort-kotlin-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/ort-kotlin-conventions.gradle.kts @@ -131,10 +131,13 @@ val mergeDetektReports = if (rootProject.tasks.findByName(mergeDetektReportsTask } } +val detekt = tasks.named("detekt") + tasks.withType().configureEach detekt@{ jvmTarget = maxKotlinJvmTarget.target dependsOn(":detekt-rules:assemble") + if (this != detekt.get()) mustRunAfter(detekt) exclude { "/build/generated/" in it.file.absolutePath @@ -160,6 +163,10 @@ tasks.withType().configureEach detekt@{ finalizedBy(mergeDetektReports) } +tasks.register("detektAll") { + dependsOn(tasks.withType()) +} + tasks.withType().configureEach { val hasSerializationPlugin = plugins.hasPlugin(libs.plugins.kotlinSerialization.get().pluginId)