Skip to content

Commit

Permalink
Improve test of SuppressionSpec
Browse files Browse the repository at this point in the history
  • Loading branch information
BraisGabin committed Mar 28, 2024
1 parent dbfabdc commit d1dae47
Show file tree
Hide file tree
Showing 2 changed files with 248 additions and 182 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import io.gitlab.arturbosch.detekt.api.Rule
import io.gitlab.arturbosch.detekt.api.RuleSet
import org.jetbrains.kotlin.psi.KtAnnotated
import org.jetbrains.kotlin.psi.KtElement
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType

/**
Expand All @@ -24,7 +23,7 @@ private fun KtElement.findAnnotatedSuppressedParent(
val parent = getStrictParentOfType<KtAnnotated>()

var suppressed = false
if (parent != null && parent !is KtFile) {
if (parent != null) {
suppressed = if (parent.isSuppressedBy(id, aliases, ruleSetId)) {
true
} else {
Expand Down
Loading

0 comments on commit d1dae47

Please sign in to comment.