io.gitlab.arturbosch.detekt.test.Resources.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of detekt-test Show documentation
Show all versions of detekt-test Show documentation
Static code analysis for Kotlin
package io.gitlab.arturbosch.detekt.test
import io.gitlab.arturbosch.detekt.api.internal.YamlConfig
import java.net.URI
internal object Resources
fun resource(name: String): URI {
val explicitName = if (name.startsWith("/")) name else "/$name"
val resource = Resources::class.java.getResource(explicitName)
requireNotNull(resource) { "Make sure the resource '$name' exists!" }
return resource.toURI()
}
fun yamlConfig(name: String) = YamlConfig.loadResource(resource(name).toURL())
© 2015 - 2025 Weber Informatics LLC | Privacy Policy