From 23ebd9ffeb4ce61c14c0a2632a6e47cd1ea3bd2d Mon Sep 17 00:00:00 2001 From: Nariman Abdullin Date: Tue, 15 Nov 2022 16:46:08 +0300 Subject: [PATCH 01/12] Downgrade ktlint ### What's done: * downgraded ktlint to 0.46.1 It closes #1564 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e3d68692e1..54391aa8ae 100644 --- a/pom.xml +++ b/pom.xml @@ -46,7 +46,7 @@ true official 1.4.1 - 0.47.1 + 0.46.1 5.9.1 1.9.1 1.1.0 From 5bf16637a9e57078c1ab02010882b611b02e26df Mon Sep 17 00:00:00 2001 From: Nariman Abdullin Date: Tue, 15 Nov 2022 17:07:43 +0300 Subject: [PATCH 02/12] updated rest parts --- README.md | 2 +- diktat-gradle-plugin/build.gradle.kts | 2 +- .../kotlin/org/cqfn/diktat/ruleset/smoke/DiktatSaveSmokeTest.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a942c33792..d00affdb1c 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Main features of diktat are the following: ```shell # another option is "brew install ktlint" - curl -sSLO https://github.com/pinterest/ktlint/releases/download/0.47.1/ktlint && chmod a+x ktlint + curl -sSLO https://github.com/pinterest/ktlint/releases/download/0.46.1/ktlint && chmod a+x ktlint ``` 1. Load diKTat manually: [here](https://github.com/saveourtool/diKTat/releases/download/v1.2.4/diktat-1.2.4.jar) diff --git a/diktat-gradle-plugin/build.gradle.kts b/diktat-gradle-plugin/build.gradle.kts index d83551ed0b..e478515701 100644 --- a/diktat-gradle-plugin/build.gradle.kts +++ b/diktat-gradle-plugin/build.gradle.kts @@ -28,7 +28,7 @@ repositories { // default value is needed for correct gradle loading in IDEA; actual value from maven is used during build // To debug gradle plugin, please set `diktatVersion` manually to the current maven project version. -val ktlintVersion = project.properties.getOrDefault("ktlintVersion", "0.47.1") as String +val ktlintVersion = project.properties.getOrDefault("ktlintVersion", "0.46.1") as String val diktatVersion = project.version.takeIf { it.toString() != Project.DEFAULT_VERSION } ?: "1.2.3" val junitVersion = project.properties.getOrDefault("junitVersion", "5.8.1") as String val jacocoVersion = project.properties.getOrDefault("jacocoVersion", "0.8.7") as String diff --git a/diktat-ruleset/src/test/kotlin/org/cqfn/diktat/ruleset/smoke/DiktatSaveSmokeTest.kt b/diktat-ruleset/src/test/kotlin/org/cqfn/diktat/ruleset/smoke/DiktatSaveSmokeTest.kt index 37c753bf73..04c35ae6ea 100644 --- a/diktat-ruleset/src/test/kotlin/org/cqfn/diktat/ruleset/smoke/DiktatSaveSmokeTest.kt +++ b/diktat-ruleset/src/test/kotlin/org/cqfn/diktat/ruleset/smoke/DiktatSaveSmokeTest.kt @@ -138,7 +138,7 @@ class DiktatSaveSmokeTest : DiktatSmokeTestBase() { private const val BASE_DIRECTORY = "src/test/resources/test/smoke" private const val BUILD_DIRECTORY = "target" private const val FAT_JAR_GLOB = "diktat-*.jar" - private const val KTLINT_VERSION = "0.47.1" + private const val KTLINT_VERSION = "0.46.1" private const val SAVE_VERSION: String = "0.3.4" private val baseDirectoryPath = Path(BASE_DIRECTORY).absolute() From 9a064fbbfe3de1d5ad52b227221f55aa35b5dc10 Mon Sep 17 00:00:00 2001 From: Nariman Abdullin Date: Tue, 15 Nov 2022 17:10:33 +0300 Subject: [PATCH 03/12] reverted changed related to KtLint --- .../cqfn/diktat/ruleset/rules/DiktatRule.kt | 6 +++--- .../diktat/ruleset/rules/OrderedRuleSet.kt | 21 ------------------- 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/DiktatRule.kt b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/DiktatRule.kt index b37b46f15b..96487958a1 100644 --- a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/DiktatRule.kt +++ b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/DiktatRule.kt @@ -34,7 +34,7 @@ abstract class DiktatRule( /** * The **file-specific** error emitter, initialized in - * [beforeVisitChildNodes] and used in [logic] implementations. + * [visit] and used in [logic] implementations. * * Since the file is indirectly a part of the state of a `Rule`, the same * `Rule` instance should **never be re-used** to check more than a single @@ -42,13 +42,13 @@ abstract class DiktatRule( * See the documentation of the [Rule] class for more details. * * @see Rule - * @see beforeVisitChildNodes + * @see visit * @see logic */ lateinit var emitWarn: EmitType @Suppress("TooGenericExceptionThrown") - final override fun beforeVisitChildNodes( + final override fun visit( node: ASTNode, autoCorrect: Boolean, emit: EmitType diff --git a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/OrderedRuleSet.kt b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/OrderedRuleSet.kt index 7040128b60..62178544db 100644 --- a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/OrderedRuleSet.kt +++ b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/OrderedRuleSet.kt @@ -8,7 +8,6 @@ import org.cqfn.diktat.common.config.rules.qualifiedWithRuleSetId import org.cqfn.diktat.ruleset.constants.EmitType import com.pinterest.ktlint.core.Rule import com.pinterest.ktlint.core.RuleSet -import com.pinterest.ktlint.core.api.EditorConfigProperties import org.jetbrains.kotlin.com.intellij.lang.ASTNode /** @@ -81,16 +80,6 @@ class OrderedRuleSet(id: String, vararg rules: Rule) : RuleSet(id, rules = adjus val rule: Rule, prevRule: Rule ) : Rule(rule.id.qualifiedWithRuleSetId(ruleSetId), adjustVisitorModifiers(ruleSetId, rule, prevRule)) { - override fun beforeFirstNode(editorConfigProperties: EditorConfigProperties) = - rule.beforeFirstNode(editorConfigProperties) - - override fun beforeVisitChildNodes( - node: ASTNode, - autoCorrect: Boolean, - emit: EmitType, - ) = - rule.beforeVisitChildNodes(node, autoCorrect, emit) - @Deprecated( "Marked for deletion in ktlint 0.48.0", replaceWith = ReplaceWith("beforeVisitChildNodes(node, autoCorrect, emit)"), @@ -101,16 +90,6 @@ class OrderedRuleSet(id: String, vararg rules: Rule) : RuleSet(id, rules = adjus emit: EmitType, ) = rule.visit(node, autoCorrect, emit) - - override fun afterVisitChildNodes( - node: ASTNode, - autoCorrect: Boolean, - emit: EmitType, - ) = - rule.afterVisitChildNodes(node, autoCorrect, emit) - - override fun afterLastNode() = - rule.afterLastNode() } } } From c2d41a2e8427abd2c67a94e782022e8a888a0f1a Mon Sep 17 00:00:00 2001 From: Nariman Abdullin Date: Tue, 15 Nov 2022 17:13:32 +0300 Subject: [PATCH 04/12] reverted changed related to KtLint #2 --- .../org/cqfn/diktat/ruleset/rules/chapter6/RunInScript.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter6/RunInScript.kt b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter6/RunInScript.kt index bd4259cecf..c00cfc01eb 100644 --- a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter6/RunInScript.kt +++ b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter6/RunInScript.kt @@ -27,7 +27,7 @@ class RunInScript(private val configRules: List) : Rule(NAME_ID.qua private var isFixMode: Boolean = false private lateinit var emitWarn: EmitType - override fun beforeVisitChildNodes( + override fun visit( node: ASTNode, autoCorrect: Boolean, emit: EmitType From 9bc42427cb2926cb58aeea2803061b7a26a938e9 Mon Sep 17 00:00:00 2001 From: Nariman Abdullin Date: Tue, 15 Nov 2022 17:22:08 +0300 Subject: [PATCH 05/12] reverted changed related to KtLint #3 --- .../org/cqfn/diktat/ruleset/rules/OrderedRuleSetTest.kt | 2 +- .../org/cqfn/diktat/ruleset/utils/AstNodeUtilsTest.kt | 6 +++--- .../src/test/kotlin/org/cqfn/diktat/util/TestUtils.kt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/rules/OrderedRuleSetTest.kt b/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/rules/OrderedRuleSetTest.kt index 83112cc15b..c990831cfa 100644 --- a/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/rules/OrderedRuleSetTest.kt +++ b/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/rules/OrderedRuleSetTest.kt @@ -152,7 +152,7 @@ class OrderedRuleSetTest { visitorModifiers: Set = emptySet(), onVisit: (Rule) -> Unit = { } ): Rule = object : Rule(id.qualifiedWithRuleSetId(), visitorModifiers) { - override fun beforeVisitChildNodes( + override fun visit( node: ASTNode, autoCorrect: Boolean, emit: EmitType diff --git a/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/utils/AstNodeUtilsTest.kt b/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/utils/AstNodeUtilsTest.kt index 0adc251de5..db62fe1d78 100644 --- a/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/utils/AstNodeUtilsTest.kt +++ b/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/utils/AstNodeUtilsTest.kt @@ -792,9 +792,9 @@ private class PrettyPrintingVisitor(private val elementType: IElementType, private val maxLevel: Int, private val expected: String ) : Rule("print-ast") { - override fun beforeVisitChildNodes(node: ASTNode, - autoCorrect: Boolean, - emit: EmitType + override fun visit(node: ASTNode, + autoCorrect: Boolean, + emit: EmitType ) { if (node.elementType == elementType) { Assertions.assertEquals( diff --git a/diktat-rules/src/test/kotlin/org/cqfn/diktat/util/TestUtils.kt b/diktat-rules/src/test/kotlin/org/cqfn/diktat/util/TestUtils.kt index 28af015790..c94f1f63c5 100644 --- a/diktat-rules/src/test/kotlin/org/cqfn/diktat/util/TestUtils.kt +++ b/diktat-rules/src/test/kotlin/org/cqfn/diktat/util/TestUtils.kt @@ -51,7 +51,7 @@ internal fun applyToCode(code: String, text = code, ruleSets = listOf( RuleSet("test", object : Rule("astnode-utils-test") { - override fun beforeVisitChildNodes(node: ASTNode, + override fun visit(node: ASTNode, autoCorrect: Boolean, emit: EmitType ) { From 90ec34f99692b594f583522d20cbf442e483436f Mon Sep 17 00:00:00 2001 From: Nariman Abdullin Date: Tue, 15 Nov 2022 17:29:32 +0300 Subject: [PATCH 06/12] reverted changed related to KtLint #4 --- .../cqfn/diktat/plugin/maven/DiktatBaseMojo.kt | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/diktat-maven-plugin/src/main/kotlin/org/cqfn/diktat/plugin/maven/DiktatBaseMojo.kt b/diktat-maven-plugin/src/main/kotlin/org/cqfn/diktat/plugin/maven/DiktatBaseMojo.kt index 311564e9eb..34f4bcb622 100644 --- a/diktat-maven-plugin/src/main/kotlin/org/cqfn/diktat/plugin/maven/DiktatBaseMojo.kt +++ b/diktat-maven-plugin/src/main/kotlin/org/cqfn/diktat/plugin/maven/DiktatBaseMojo.kt @@ -11,10 +11,9 @@ import com.pinterest.ktlint.core.LintError import com.pinterest.ktlint.core.Reporter import com.pinterest.ktlint.core.RuleExecutionException import com.pinterest.ktlint.core.RuleSet -import com.pinterest.ktlint.core.api.Baseline -import com.pinterest.ktlint.core.api.Baseline.Status.VALID -import com.pinterest.ktlint.core.api.containsLintError -import com.pinterest.ktlint.core.api.loadBaseline +import com.pinterest.ktlint.core.internal.CurrentBaseline +import com.pinterest.ktlint.core.internal.containsLintError +import com.pinterest.ktlint.core.internal.loadBaseline import com.pinterest.ktlint.reporter.baseline.BaselineReporter import com.pinterest.ktlint.reporter.html.HtmlReporter import com.pinterest.ktlint.reporter.json.JsonReporter @@ -121,7 +120,7 @@ abstract class DiktatBaseMojo : AbstractMojo() { listOf(DiktatRuleSetProvider(configFile).get()) } val baselineResults = baseline?.let { loadBaseline(it.absolutePath) } - ?: Baseline(status = VALID) + ?: CurrentBaseline(emptyMap(), false) reporterImpl = resolveReporter(baselineResults) reporterImpl.beforeAll() val lintErrors: MutableList = mutableListOf() @@ -129,7 +128,7 @@ abstract class DiktatBaseMojo : AbstractMojo() { inputs .map(::File) .forEach { - checkDirectory(it, lintErrors, baselineResults.lintErrorsPerFile, ruleSets) + checkDirectory(it, lintErrors, baselineResults.baselineRules ?: emptyMap(), ruleSets) } reporterImpl.afterAll() @@ -138,7 +137,7 @@ abstract class DiktatBaseMojo : AbstractMojo() { } } - private fun resolveReporter(baselineResults: Baseline): Reporter { + private fun resolveReporter(baselineResults: CurrentBaseline): Reporter { val output = if (this.output.isBlank()) { if (this.githubActions) { // need to set user.home specially for ktlint, so it will be able to put a relative path URI in SARIF @@ -166,7 +165,7 @@ abstract class DiktatBaseMojo : AbstractMojo() { } } - return if (baselineResults.status != VALID) { + return if (baselineResults.baselineGenerationNeeded) { val baselineReporter = BaselineReporter(PrintStream(FileOutputStream(baseline, true))) return Reporter.from(actualReporter, baselineReporter) } else { From 9d9a69514c59c937623f41deac3588fb0da57443 Mon Sep 17 00:00:00 2001 From: Nariman Abdullin Date: Tue, 15 Nov 2022 17:32:19 +0300 Subject: [PATCH 07/12] fixed compiling diktat.jar #3 --- diktat-ruleset/pom.xml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/diktat-ruleset/pom.xml b/diktat-ruleset/pom.xml index 9024648b37..78e5d97bb5 100644 --- a/diktat-ruleset/pom.xml +++ b/diktat-ruleset/pom.xml @@ -19,6 +19,7 @@ ${project.version} + org.jetbrains.kotlin kotlin-stdlib-common @@ -47,27 +48,27 @@ org.jetbrains.kotlin kotlin-stdlib-common - test + provided org.jetbrains.kotlin kotlin-stdlib-jdk7 - test + provided org.jetbrains.kotlin kotlin-stdlib-jdk8 - test + provided org.jetbrains.kotlin kotlin-stdlib - test + provided org.jetbrains.kotlin kotlin-compiler-embeddable - test + provided org.junit.jupiter From 5231520bcdf9f4315fa9849a9dbe25a1838507db Mon Sep 17 00:00:00 2001 From: Nariman Abdullin Date: Tue, 15 Nov 2022 17:35:23 +0300 Subject: [PATCH 08/12] Revert "fixed compiling diktat.jar #3" This reverts commit 9d9a69514c59c937623f41deac3588fb0da57443. --- diktat-ruleset/pom.xml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/diktat-ruleset/pom.xml b/diktat-ruleset/pom.xml index 78e5d97bb5..9024648b37 100644 --- a/diktat-ruleset/pom.xml +++ b/diktat-ruleset/pom.xml @@ -19,7 +19,6 @@ ${project.version} - org.jetbrains.kotlin kotlin-stdlib-common @@ -48,27 +47,27 @@ org.jetbrains.kotlin kotlin-stdlib-common - provided + test org.jetbrains.kotlin kotlin-stdlib-jdk7 - provided + test org.jetbrains.kotlin kotlin-stdlib-jdk8 - provided + test org.jetbrains.kotlin kotlin-stdlib - provided + test org.jetbrains.kotlin kotlin-compiler-embeddable - provided + test org.junit.jupiter From 226a076d0934e7cf75a08aa12e9eb356cc78aa34 Mon Sep 17 00:00:00 2001 From: Nariman Abdullin Date: Tue, 15 Nov 2022 17:57:32 +0300 Subject: [PATCH 09/12] rollback tests --- .../org/cqfn/diktat/ruleset/rules/OrderedRuleSetTest.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/rules/OrderedRuleSetTest.kt b/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/rules/OrderedRuleSetTest.kt index c990831cfa..df565c1451 100644 --- a/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/rules/OrderedRuleSetTest.kt +++ b/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/rules/OrderedRuleSetTest.kt @@ -137,9 +137,14 @@ class OrderedRuleSetTest { */ val expectedRuleInvocationOrder = rules.asSequence() .map(Rule::id) - .flatMap { ruleId -> - generateSequence { ruleId }.take(astNodeCount) + .let { ruleIds -> + generateSequence { ruleIds.toList() } + .take(astNodeCount) + .flatMap { it } } +// .flatMap { ruleId -> +// generateSequence { ruleId }.take(astNodeCount) +// } .toList() assertThat(actualRuleInvocationOrder) From 1aad4eff69c60b077377371168479be641d98db5 Mon Sep 17 00:00:00 2001 From: Nariman Abdullin Date: Tue, 15 Nov 2022 18:05:59 +0300 Subject: [PATCH 10/12] removed comments --- .../diktat/ruleset/rules/OrderedRuleSetTest.kt | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/rules/OrderedRuleSetTest.kt b/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/rules/OrderedRuleSetTest.kt index df565c1451..6f97155bb1 100644 --- a/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/rules/OrderedRuleSetTest.kt +++ b/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/rules/OrderedRuleSetTest.kt @@ -135,16 +135,11 @@ class OrderedRuleSetTest { * V * C(File) -> C(Node) -> C(Leaf) */ - val expectedRuleInvocationOrder = rules.asSequence() - .map(Rule::id) - .let { ruleIds -> - generateSequence { ruleIds.toList() } - .take(astNodeCount) - .flatMap { it } - } -// .flatMap { ruleId -> -// generateSequence { ruleId }.take(astNodeCount) -// } + val expectedRuleInvocationOrder = generateSequence { + rules.map(Rule::id) + } + .take(astNodeCount) + .flatten() .toList() assertThat(actualRuleInvocationOrder) From 40eb7c97794012affd4bb642a7559595754d1646 Mon Sep 17 00:00:00 2001 From: Nariman Abdullin Date: Tue, 15 Nov 2022 18:09:42 +0300 Subject: [PATCH 11/12] removed comments --- .../org/cqfn/diktat/ruleset/rules/OrderedRuleSetTest.kt | 7 +++++++ .../org/cqfn/diktat/ruleset/smoke/DiktatSmokeTestBase.kt | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/rules/OrderedRuleSetTest.kt b/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/rules/OrderedRuleSetTest.kt index 6f97155bb1..de65572f0b 100644 --- a/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/rules/OrderedRuleSetTest.kt +++ b/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/rules/OrderedRuleSetTest.kt @@ -134,6 +134,13 @@ class OrderedRuleSetTest { * | * V * C(File) -> C(Node) -> C(Leaf) + * + * val expectedRuleInvocationOrder = rules.asSequence() + * .map(Rule::id) + * .flatMap { ruleId -> + * generateSequence { ruleId }.take(astNodeCount) + * } + * .toList() */ val expectedRuleInvocationOrder = generateSequence { rules.map(Rule::id) diff --git a/diktat-ruleset/src/test/kotlin/org/cqfn/diktat/ruleset/smoke/DiktatSmokeTestBase.kt b/diktat-ruleset/src/test/kotlin/org/cqfn/diktat/ruleset/smoke/DiktatSmokeTestBase.kt index fbeb8c057e..cf31ebe8cd 100644 --- a/diktat-ruleset/src/test/kotlin/org/cqfn/diktat/ruleset/smoke/DiktatSmokeTestBase.kt +++ b/diktat-ruleset/src/test/kotlin/org/cqfn/diktat/ruleset/smoke/DiktatSmokeTestBase.kt @@ -238,8 +238,8 @@ abstract class DiktatSmokeTestBase { /* * This 2nd `MISSING_KDOC_ON_FUNCTION` is a duplicate caused by * https://github.com/saveourtool/diktat/issues/1538. + * LintError(6, 5, "$DIKTAT_RULE_SET_ID:${KdocMethods.NAME_ID}", "${MISSING_KDOC_ON_FUNCTION.warnText()} foo", false), */ - LintError(6, 5, "$DIKTAT_RULE_SET_ID:${KdocMethods.NAME_ID}", "${MISSING_KDOC_ON_FUNCTION.warnText()} foo", false), LintError(9, 3, "$DIKTAT_RULE_SET_ID:${EmptyBlock.NAME_ID}", EMPTY_BLOCK_STRUCTURE_ERROR.warnText() + " empty blocks are forbidden unless it is function with override keyword", false), LintError(12, 10, "$DIKTAT_RULE_SET_ID:${KdocFormatting.NAME_ID}", "${KDOC_NO_EMPTY_TAGS.warnText()} @return", false), From 715166d96413139d59f5021a01c057a3f903e5d9 Mon Sep 17 00:00:00 2001 From: Nariman Abdullin Date: Tue, 15 Nov 2022 18:20:13 +0300 Subject: [PATCH 12/12] diktatFix --- .../src/test/kotlin/org/cqfn/diktat/util/TestUtils.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/diktat-rules/src/test/kotlin/org/cqfn/diktat/util/TestUtils.kt b/diktat-rules/src/test/kotlin/org/cqfn/diktat/util/TestUtils.kt index c94f1f63c5..7e5386948b 100644 --- a/diktat-rules/src/test/kotlin/org/cqfn/diktat/util/TestUtils.kt +++ b/diktat-rules/src/test/kotlin/org/cqfn/diktat/util/TestUtils.kt @@ -51,9 +51,10 @@ internal fun applyToCode(code: String, text = code, ruleSets = listOf( RuleSet("test", object : Rule("astnode-utils-test") { - override fun visit(node: ASTNode, - autoCorrect: Boolean, - emit: EmitType + override fun visit( + node: ASTNode, + autoCorrect: Boolean, + emit: EmitType ) { applyToNode(node, counter) }