Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Fail CLI execution when unknown option provided #37

Merged
merged 1 commit into from
Jan 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package io.github.detekt.compiler.plugin
import io.github.detekt.gradle.DETEKT_COMPILER_PLUGIN
import org.jetbrains.kotlin.compiler.plugin.AbstractCliOption
import org.jetbrains.kotlin.compiler.plugin.CliOption
import org.jetbrains.kotlin.compiler.plugin.CliOptionProcessingException
import org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor
import org.jetbrains.kotlin.config.CompilerConfiguration
import java.io.ByteArrayInputStream
Expand Down Expand Up @@ -83,6 +84,7 @@ class DetektCommandLineProcessor : CommandLineProcessor {
Options.rootPath -> configuration.put(Keys.ROOT_PATH, Paths.get(value))
Options.excludes -> configuration.put(Keys.EXCLUDES, value.decodeToGlobSet())
Options.report -> configuration.put(Keys.REPORTS, value.substringBefore(':'), Paths.get(value.substringAfter(':')))
else -> throw CliOptionProcessingException("Unknown option: ${option.optionName}")
}
}
}
Expand Down