Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting default autocorrect mode with Gradle property #7040

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -39,7 +39,11 @@ class DetektBasePlugin : Plugin<Project> {
allRules.convention(DEFAULT_ALL_RULES_VALUE)
buildUponDefaultConfig.convention(DEFAULT_BUILD_UPON_DEFAULT_CONFIG_VALUE)
disableDefaultRuleSets.convention(DEFAULT_DISABLE_RULESETS_VALUE)
autoCorrect.convention(DEFAULT_AUTO_CORRECT_VALUE)
autoCorrect.convention(
project.providers.gradleProperty(ENABLE_AUTOCORRECT)
.map { it.toBoolean() }
.orElse(DEFAULT_AUTO_CORRECT_VALUE)
)
reportsDir.convention(
project.extensions.getByType(ReportingExtension::class.java).baseDirectory.dir("detekt")
)
Expand Down Expand Up @@ -118,3 +122,4 @@ class DetektBasePlugin : Plugin<Project> {
}

internal const val CONFIGURATION_DETEKT_PLUGINS = "detektPlugins"
internal const val ENABLE_AUTOCORRECT = "detekt.default.autocorrect"