Skip to content

Commit

Permalink
Remove unused dry run properties (#5158)
Browse files Browse the repository at this point in the history
  • Loading branch information
3flex committed Jul 31, 2022
1 parent fc23515 commit e5de72b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
Expand Up @@ -16,7 +16,6 @@ import io.gitlab.arturbosch.detekt.invoke.FailFastArgument
import io.gitlab.arturbosch.detekt.invoke.InputArgument
import io.gitlab.arturbosch.detekt.invoke.JvmTargetArgument
import io.gitlab.arturbosch.detekt.invoke.ParallelArgument
import io.gitlab.arturbosch.detekt.invoke.isDryRunEnabled
import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.file.FileTree
import org.gradle.api.file.RegularFileProperty
Expand Down Expand Up @@ -114,8 +113,6 @@ open class DetektCreateBaselineTask : SourceTask() {
get() = jvmTargetProp.get()
set(value) = jvmTargetProp.set(value)

private val isDryRun: Boolean = project.isDryRunEnabled()

@get:Internal
internal val arguments: Provider<List<String>> = project.provider {
listOf(
Expand Down Expand Up @@ -148,7 +145,7 @@ open class DetektCreateBaselineTask : SourceTask() {
logger.warn("'failFast' is deprecated. Please use 'buildUponDefaultConfig' together with 'allRules'.")
}

DetektInvoker.create(task = this, isDryRun = isDryRun).invokeCli(
DetektInvoker.create(task = this).invokeCli(
arguments = arguments.get(),
ignoreFailures = ignoreFailures.getOrElse(false),
classpath = detektClasspath.plus(pluginClasspath),
Expand Down
Expand Up @@ -6,7 +6,6 @@ import io.gitlab.arturbosch.detekt.invoke.CliArgument
import io.gitlab.arturbosch.detekt.invoke.ConfigArgument
import io.gitlab.arturbosch.detekt.invoke.DetektInvoker
import io.gitlab.arturbosch.detekt.invoke.GenerateConfigArgument
import io.gitlab.arturbosch.detekt.invoke.isDryRunEnabled
import org.gradle.api.DefaultTask
import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.model.ObjectFactory
Expand Down Expand Up @@ -44,8 +43,6 @@ open class DetektGenerateConfigTask @Inject constructor(
@get:PathSensitive(PathSensitivity.RELATIVE)
val config: ConfigurableFileCollection = project.objects.fileCollection()

private val isDryRun: Boolean = project.isDryRunEnabled()

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

private val configurationToUse = if (config.isEmpty) {
Expand All @@ -71,7 +68,7 @@ open class DetektGenerateConfigTask @Inject constructor(

Files.createDirectories(configurationToUse.last().parentFile.toPath())

DetektInvoker.create(task = this, isDryRun = isDryRun).invokeCli(
DetektInvoker.create(task = this).invokeCli(
arguments = arguments.get(),
classpath = detektClasspath.plus(pluginClasspath),
taskName = name,
Expand Down
Expand Up @@ -21,7 +21,7 @@ internal interface DetektInvoker {

companion object {

fun create(task: Task, isDryRun: Boolean): DetektInvoker =
fun create(task: Task, isDryRun: Boolean = false): DetektInvoker =
if (isDryRun) {
DryRunInvoker(task.logger)
} else {
Expand Down

0 comments on commit e5de72b

Please sign in to comment.