Skip to content

Commit

Permalink
ReturnCount.excludedFunctions should be a List<String>
Browse files Browse the repository at this point in the history
  • Loading branch information
gouri-panda committed Jul 15, 2022
1 parent 6bce28f commit b120709
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Expand Up @@ -7,7 +7,6 @@ import io.gitlab.arturbosch.detekt.api.Entity
import io.gitlab.arturbosch.detekt.api.Issue
import io.gitlab.arturbosch.detekt.api.Rule
import io.gitlab.arturbosch.detekt.api.Severity
import io.gitlab.arturbosch.detekt.api.SplitPattern
import io.gitlab.arturbosch.detekt.api.config
import io.gitlab.arturbosch.detekt.api.internal.ActiveByDefault
import io.gitlab.arturbosch.detekt.api.internal.Configuration
Expand Down Expand Up @@ -59,8 +58,8 @@ class ReturnCount(config: Config = Config.empty) : Rule(config) {
@Configuration("define the maximum number of return statements allowed per function")
private val max: Int by config(2)

@Configuration("define a free-form comma separated list of function names to be ignored by this check")
private val excludedFunctions: SplitPattern by config("equals") { SplitPattern(it) }
@Configuration("define a list of function names to be ignored by this check")
private val excludedFunctions: List<String> by config(emptyList())

@Configuration("if labeled return statements should be ignored")
private val excludeLabeled: Boolean by config(false)
Expand Down
Expand Up @@ -347,7 +347,7 @@ class ReturnCountSpec {
TestConfig(
mapOf(
MAX to "2",
EXCLUDED_FUNCTIONS to "test1,test2"
EXCLUDED_FUNCTIONS to listOf("test1", "test2")
)
)
).compileAndLint(code)
Expand Down

0 comments on commit b120709

Please sign in to comment.