From 1f101c07e89dc4e818f9c769115ee0cfde13c85b Mon Sep 17 00:00:00 2001 From: Andrey Kuleshov Date: Fri, 9 Jun 2023 16:52:14 +0300 Subject: [PATCH] Github action for snapshot diktat --- .github/workflows/diktat_snapshot.yml | 4 ++++ gradle/plugins/build.gradle.kts | 1 + .../diktat/buildutils/code-quality-convention.gradle.kts | 2 +- .../buildutils/diktat-convention-configuration.gradle.txt | 1 - 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/diktat_snapshot.yml b/.github/workflows/diktat_snapshot.yml index 448225389a..8477cfe0bc 100644 --- a/.github/workflows/diktat_snapshot.yml +++ b/.github/workflows/diktat_snapshot.yml @@ -57,6 +57,10 @@ jobs: # FixMe: return after 2.0.0 # -x diktatCheck + - name: 'Copy files and set flags' + run: | + echo "DIKTAT_SNAPSHOT=1" >> $GITHUB_ENV + mv gradle/plugins/src/main/kotlin/com/saveourtool/diktat/buildutils/diktat-convention-configuration.gradle.txt gradle/plugins/src/main/kotlin/com/saveourtool/diktat/buildutils/diktat-convention-configuration.gradle.kts - name: 'Override ' run: | diff --git a/gradle/plugins/build.gradle.kts b/gradle/plugins/build.gradle.kts index 07b3ca911c..f042f4674d 100644 --- a/gradle/plugins/build.gradle.kts +++ b/gradle/plugins/build.gradle.kts @@ -16,6 +16,7 @@ repositories { gradlePluginPortal() } +@Suppress("COMMENTED_OUT_CODE", "WRONG_INDENTATION") dependencies { // workaround https://github.com/gradle/gradle/issues/15383 implementation(files(project.libs.javaClass.superclass.protectionDomain.codeSource.location)) diff --git a/gradle/plugins/src/main/kotlin/com/saveourtool/diktat/buildutils/code-quality-convention.gradle.kts b/gradle/plugins/src/main/kotlin/com/saveourtool/diktat/buildutils/code-quality-convention.gradle.kts index c08fad2fdd..4b66ccae96 100644 --- a/gradle/plugins/src/main/kotlin/com/saveourtool/diktat/buildutils/code-quality-convention.gradle.kts +++ b/gradle/plugins/src/main/kotlin/com/saveourtool/diktat/buildutils/code-quality-convention.gradle.kts @@ -1,8 +1,8 @@ package com.saveourtool.diktat.buildutils +@Suppress("AVOID_NULL_CHECKS") plugins { id("com.saveourtool.diktat.buildutils.detekt-convention-configuration") - // FixMe: remove after 2.0.0 if (System.getenv("DIKTAT_SNAPSHOT") != null) { id("com.saveourtool.diktat.buildutils.diktat-convention-configuration") } diff --git a/gradle/plugins/src/main/kotlin/com/saveourtool/diktat/buildutils/diktat-convention-configuration.gradle.txt b/gradle/plugins/src/main/kotlin/com/saveourtool/diktat/buildutils/diktat-convention-configuration.gradle.txt index 827cbc60ee..af84f299f7 100644 --- a/gradle/plugins/src/main/kotlin/com/saveourtool/diktat/buildutils/diktat-convention-configuration.gradle.txt +++ b/gradle/plugins/src/main/kotlin/com/saveourtool/diktat/buildutils/diktat-convention-configuration.gradle.txt @@ -1,6 +1,5 @@ package com.saveourtool.diktat.buildutils - plugins { id("com.saveourtool.diktat.diktat-gradle-plugin") }