Skip to content

Commit

Permalink
Change how we instanciate the rules (#7262)
Browse files Browse the repository at this point in the history
  • Loading branch information
BraisGabin committed May 7, 2024
1 parent 0951519 commit 87414a0
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -94,9 +94,12 @@ internal class Analyzer(

val (correctableRules, otherRules) = activeRuleSetsToRuleSetConfigs
.flatMap { (ruleSet, ruleSetConfig) ->
ruleSet.rules
ruleSetConfig.subConfigKeys()
.asSequence()
.map { (ruleId, ruleProvider) -> ruleProvider to ruleSetConfig.subConfig(ruleId.value) }
.mapNotNull { runCatching { Rule.Id(it) }.getOrNull() }
.mapNotNull { ruleId ->
ruleSet.rules[ruleId]?.let { it to ruleSetConfig.subConfig(ruleId.value) }
}
.filter { (_, config) -> config.isActiveOrDefault(false) }
.filter { (_, config) -> config.shouldAnalyzeFile(file, settings.spec.projectSpec.basePath) }
.map { (ruleProvider, config) ->
Expand Down

0 comments on commit 87414a0

Please sign in to comment.