Skip to content

Commit

Permalink
Use getter when determining whether custom config path is set in Dete…
Browse files Browse the repository at this point in the history
…ktGenerateConfigTask (#5157)
  • Loading branch information
3flex committed Jul 31, 2022
1 parent e5de72b commit 9b5e12a
Showing 1 changed file with 6 additions and 5 deletions.
Expand Up @@ -45,11 +45,12 @@ open class DetektGenerateConfigTask @Inject constructor(

private val defaultConfigPath = project.rootDir.toPath().resolve(CONFIG_DIR_NAME).resolve(CONFIG_FILE)

private val configurationToUse = if (config.isEmpty) {
objects.fileCollection().from(defaultConfigPath)
} else {
config
}
private val configurationToUse: ConfigurableFileCollection
get() = if (config.isEmpty) {
objects.fileCollection().from(defaultConfigPath)
} else {
config
}

@get:Internal
internal val arguments: Provider<List<String>> = project.provider {
Expand Down

0 comments on commit 9b5e12a

Please sign in to comment.