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 18, 2022
1 parent 6bce28f commit 1dc5b15
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion detekt-core/src/main/resources/default-detekt-config.yml
Expand Up @@ -626,7 +626,8 @@ style:
ReturnCount:
active: true
max: 2
excludedFunctions: 'equals'
excludedFunctions:
- 'equals'
excludeLabeled: false
excludeReturnFromLambda: true
excludeGuardClauses: false
Expand Down
Expand Up @@ -59,8 +59,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: SplitPattern by config(listOf("equals")) { SplitPattern(it.joinToString(",")) }

@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 1dc5b15

Please sign in to comment.