-
-
Notifications
You must be signed in to change notification settings - Fork 758
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consider deprecated rules as inactive when running
allRules
(#6381)
- Loading branch information
Showing
4 changed files
with
83 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
detekt-core/src/test/kotlin/io/gitlab/arturbosch/detekt/core/LoadDeprecatedRuleIdsSpec.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.gitlab.arturbosch.detekt.core | ||
|
||
import org.assertj.core.api.Assertions.assertThat | ||
import org.junit.jupiter.api.Test | ||
|
||
class LoadDeprecatedRuleIdsSpec { | ||
@Test | ||
fun loadDeprecatedRules() { | ||
// rule id as used by config path mechanism uses 'ruleSetId > ruleId' pattern (with space) | ||
val ruleIdPattern = """^[-\w]+ > \w+$""".toRegex() | ||
|
||
val actual = loadDeprecatedRuleIds() | ||
|
||
assertThat(actual) | ||
.isNotEmpty() | ||
.allMatch { ruleId -> ruleIdPattern.matches(ruleId as String) } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters