All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.gitlab.arturbosch.detekt.test.RuleSetExtensions.kt Maven / Gradle / Ivy

package io.gitlab.arturbosch.detekt.test

import io.gitlab.arturbosch.detekt.api.Config
import io.gitlab.arturbosch.detekt.api.RuleSetProvider
import io.gitlab.arturbosch.detekt.core.rules.createRuleSet

/**
 * Creates a RuleSet instance of given RuleSetProvider.
 */
inline fun  loadRuleSet(config: Config = Config.empty) =
    (T::class.java.constructors[0].newInstance() as? T)
        ?.createRuleSet(config)
        ?: error("Could not load RuleSet for '${T::class.java}'")




© 2015 - 2025 Weber Informatics LLC | Privacy Policy