From 5814edb235000c5bd8d9f32b8c274bf973c56fb4 Mon Sep 17 00:00:00 2001 From: Andrey Kuleshov Date: Mon, 30 May 2022 17:14:31 +0300 Subject: [PATCH] Adding new logic for suppressing inspection ### What's done: - detekt fixes --- .../main/kotlin/org/cqfn/diktat/ruleset/utils/AstNodeUtils.kt | 2 +- .../src/test/kotlin/org/cqfn/diktat/util/SuppressingTest.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/utils/AstNodeUtils.kt b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/utils/AstNodeUtils.kt index eff733560b..2fb9170d58 100644 --- a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/utils/AstNodeUtils.kt +++ b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/utils/AstNodeUtils.kt @@ -983,7 +983,7 @@ private fun hasAnySuppressorForInspection( } ?.findAllDescendantsWithSpecificType(ANNOTATION_ENTRY) ?.map { it.psi as KtAnnotationEntry } - ?: setOf() + ?: emptySet() val foundSuppress = annotationsForNode.containSuppressWithName(warningName) diff --git a/diktat-rules/src/test/kotlin/org/cqfn/diktat/util/SuppressingTest.kt b/diktat-rules/src/test/kotlin/org/cqfn/diktat/util/SuppressingTest.kt index 5549f2fb2c..ed97449303 100644 --- a/diktat-rules/src/test/kotlin/org/cqfn/diktat/util/SuppressingTest.kt +++ b/diktat-rules/src/test/kotlin/org/cqfn/diktat/util/SuppressingTest.kt @@ -26,7 +26,7 @@ import org.junit.jupiter.api.Test class SuppressingTest : LintTestBase(::IdentifierNaming) { private val ruleId: String = "$DIKTAT_RULE_SET_ID:${IdentifierNaming.NAME_ID}" private val rulesConfigBooleanFunctions: List = listOf( - RulesConfig(IDENTIFIER_LENGTH.name, true, mapOf(), setOf("MySuperSuppress")) + RulesConfig(IDENTIFIER_LENGTH.name, true, emptyMap(), setOf("MySuperSuppress")) ) @Test