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

chore(deps): update detekt to v1.23.4 #231

Merged
merged 5 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
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
@@ -1,19 +1,23 @@
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.DetektPlugin
import io.gitlab.arturbosch.detekt.extensions.DetektExtension
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.apply
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.withType

internal class DetektConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
pluginManager.apply(DetektPlugin::class)
configure<DetektExtension> {
config = rootProject.files(DETEKT_CONFIG_FILE)
reports.html {
enabled = true
destination = file("build/reports/detekt.html")
configure<DetektExtension> { config.setFrom(rootProject.files(DETEKT_CONFIG_FILE)) }
tasks.withType<Detekt>().configureEach { task ->
task.reports.html {
it.required.set(true)
it.outputLocation.set(
rootProject.layout.buildDirectory.file("reports/detekt.html")
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,19 @@ public class RootProjectPlugin : Plugin<Project> {
listOf("build", "resources", "tools", "scripts").joinToString(separator = ",") {
"**/$it/*"
}
val params = listOf("--input", input, "--config", config, "--excludes", excludes)
val reports = "txt:${rootProject.layout.buildDirectory.get()}/reports/detektAll.txt"
val params =
listOf(
"--input",
input,
"--config",
config,
"--excludes",
excludes,
"--report",
reports,
"--debug"
)
args = params
doFirst { logger.lifecycle("Running detekt cli tool with parameters: $params") }
}
Expand Down
115 changes: 3 additions & 112 deletions config/detekt/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,115 +213,6 @@ exceptions:
- Throwable
- RuntimeException

formatting:
active: true
android: false
autoCorrect: true
AnnotationOnSeparateLine:
active: false
autoCorrect: true
ChainWrapping:
active: true
autoCorrect: true
CommentSpacing:
active: true
autoCorrect: true
EnumEntryNameCase:
active: false
autoCorrect: true
Filename:
active: true
FinalNewline:
active: true
autoCorrect: true
insertFinalNewLine: true
ImportOrdering:
active: false
autoCorrect: true
Indentation:
active: false
autoCorrect: true
indentSize: 4
continuationIndentSize: 4
MaximumLineLength:
active: true
maxLineLength: 120
ModifierOrdering:
active: true
autoCorrect: true
MultiLineIfElse:
active: true
autoCorrect: true
NoBlankLineBeforeRbrace:
active: true
autoCorrect: true
NoConsecutiveBlankLines:
active: true
autoCorrect: true
NoEmptyClassBody:
active: true
autoCorrect: true
NoEmptyFirstLineInMethodBlock:
active: false
autoCorrect: true
NoLineBreakAfterElse:
active: true
autoCorrect: true
NoLineBreakBeforeAssignment:
active: true
autoCorrect: true
NoMultipleSpaces:
active: true
autoCorrect: true
NoSemicolons:
active: true
autoCorrect: true
NoTrailingSpaces:
active: true
autoCorrect: true
NoUnitReturn:
active: true
autoCorrect: true
NoUnusedImports:
active: true
autoCorrect: true
NoWildcardImports:
active: true
PackageName:
active: true
autoCorrect: true
ParameterListWrapping:
active: true
autoCorrect: true
indentSize: 4
SpacingAroundColon:
active: true
autoCorrect: true
SpacingAroundComma:
active: true
autoCorrect: true
SpacingAroundCurly:
active: true
autoCorrect: true
SpacingAroundDot:
active: true
autoCorrect: true
SpacingAroundKeyword:
active: true
autoCorrect: true
SpacingAroundOperators:
active: true
autoCorrect: true
SpacingAroundParens:
active: true
autoCorrect: true
SpacingAroundRangeOperator:
active: true
autoCorrect: true
StringTemplate:
active: true
autoCorrect: true

naming:
active: true
ClassNaming:
Expand Down Expand Up @@ -473,7 +364,7 @@ style:
active: false
DataClassContainsFunctions:
active: false
conversionFunctionPrefix: 'to'
conversionFunctionPrefix: ['to']
DataClassShouldBeImmutable:
active: false
EqualsNullCall:
Expand Down Expand Up @@ -508,7 +399,7 @@ style:
FunctionOnlyReturningConstant:
active: true
ignoreOverridableFunction: true
excludedFunctions: 'describeContents'
excludedFunctions: ['describeContents']
excludeAnnotatedFunction: ['dagger.Provides']
LibraryCodeMustSpecifyReturnType:
active: true
Expand Down Expand Up @@ -565,7 +456,7 @@ style:
ReturnCount:
active: true
max: 2
excludedFunctions: 'equals'
excludedFunctions: ['equals']
excludeLabeled: false
excludeReturnFromLambda: true
excludeGuardClauses: false
Expand Down
1 change: 0 additions & 1 deletion core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
plugins {
alias(libs.plugins.maplib.kotlin.library)
alias(libs.plugins.kotlin.serialization)
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
assertk = "0.28.0"
beagle = "2.9.0"
detekt = "1.18.1"
detekt = "1.23.4"
firebase = "32.7.0"
kotest = "5.8.0"
kotlin = "1.9.20"
Expand Down
1 change: 0 additions & 1 deletion util/logging/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
plugins { alias(libs.plugins.maplib.kotlin.library) }

dependencies { api(libs.kermit.core) }
Expand Down
1 change: 0 additions & 1 deletion util/logging/test/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
plugins { alias(libs.plugins.maplib.kotlin.library) }

dependencies { implementation(projects.util.logging) }