Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Forbid Url.openStream calls and Class.getResourceAsStream
- Loading branch information
1 parent
222322d
commit 67993bb
Showing
7 changed files
with
11 additions
and
3 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
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
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
3 changes: 2 additions & 1 deletion
3
detekt-test/src/main/kotlin/io/gitlab/arturbosch/detekt/test/Resources.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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
package io.gitlab.arturbosch.detekt.test | ||
|
||
import io.github.detekt.test.utils.resource | ||
import io.github.detekt.utils.openSafeStream | ||
import io.gitlab.arturbosch.detekt.api.Config | ||
import io.gitlab.arturbosch.detekt.core.config.YamlConfig | ||
import java.io.StringReader | ||
|
||
fun yamlConfig(name: String) = resource(name).toURL().openStream().reader().use(YamlConfig::load) | ||
fun yamlConfig(name: String) = resource(name).toURL().openSafeStream().reader().use(YamlConfig::load) | ||
|
||
fun yamlConfigFromContent(content: String): Config = StringReader(content.trimIndent()).use(YamlConfig::load) |