From 5ca049f588623d7edc5acd3d3433d31ab3d0bcdc Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Sat, 29 Apr 2023 23:57:25 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20Lint=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle.kts | 9 +++++ detekt.yml | 99 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 detekt.yml diff --git a/build.gradle.kts b/build.gradle.kts index 3bc19e7c..5cdda4d7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,6 +9,7 @@ plugins { kotlin("jvm") version "1.8.21" id("io.ktor.plugin") version "2.3.0" id("org.graalvm.buildtools.native") version "0.9.21" + id("io.gitlab.arturbosch.detekt") version "1.22.0" // id("org.jetbrains.kotlin.plugin.serialization") version "1.8.10" } @@ -88,6 +89,7 @@ dependencies { testImplementation("org.slf4j:slf4j-simple:2.0.7") + detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.22.0") } jib { @@ -129,3 +131,10 @@ graalvmNative { } } } + +detekt { + parallel = true + config = files("detekt.yml") + buildUponDefaultConfig = true + basePath = rootDir.absolutePath +} diff --git a/detekt.yml b/detekt.yml new file mode 100644 index 00000000..faeab0d6 --- /dev/null +++ b/detekt.yml @@ -0,0 +1,99 @@ +style: + ClassOrdering: + active: true + + MandatoryBracesIfStatements: + active: true + + MandatoryBracesLoops: + active: true + + MultilineLambdaItParameter: + active: true + + UseEmptyCounterpart: + active: true + +complexity: + CognitiveComplexMethod: + active: true + + ComplexCondition: + active: true + + ComplexInterface: + active: true + + LabeledExpression: + active: true + + NamedArguments: + active: true + + NestedBlockDepth: + active: true + + NestedScopeFunctions: + active: true + + ReplaceSafeCallChainWithRun: + active: true + + StringLiteralDuplication: + active: true + +exceptions: + ExceptionRaisedInUnexpectedLocation: + active: true + + NotImplementedDeclaration: + active: true + + ObjectExtendsThrowable: + active: true + + ThrowingExceptionInMain: + active: true + + ThrowingExceptionsWithoutMessageOrCause: + active: true + + ThrowingNewInstanceOfSameException: + active: true + + TooGenericExceptionCaught: + active: true + + TooGenericExceptionThrown: + active: true + +formatting: + Indentation: + indentSize: 4 + +naming: + FunctionMaxLength: + active: true + + FunctionMinLength: + active: true + + LambdaParameterNaming: + active: true + +performance: + UnnecessaryPartOfBinaryExpression: + active: true + + UnnecessaryTemporaryInstantiation: + active: true + +potential-bugs: + CastToNullableType: + active: true + + DontDowncastCollectionTypes: + active: true + + ElseCaseInsteadOfExhaustiveWhen: + active: true