Skip to content

Commit

Permalink
Add detekt linter
Browse files Browse the repository at this point in the history
  • Loading branch information
anti-social committed Sep 20, 2021
1 parent 5b2e5cd commit 6fad040
Show file tree
Hide file tree
Showing 3 changed files with 817 additions and 2 deletions.
20 changes: 18 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension

plugins {
kotlin("multiplatform") apply false
id("org.jetbrains.dokka") version "1.5.0"
id("ru.vyarus.mkdocs") version "2.1.1"
id("io.gitlab.arturbosch.detekt") version Versions.detekt apply false
id("org.jetbrains.dokka") version Versions.dokka
id("ru.vyarus.mkdocs") version Versions.mkdocs
}

// Collect all source and class directories for jacoco
Expand Down Expand Up @@ -34,12 +35,21 @@ allprojects {
apply {
plugin("org.jetbrains.kotlin.multiplatform")
plugin("jacoco")
plugin("io.gitlab.arturbosch.detekt")
}

repositories {
mavenCentral()
}

configure<io.gitlab.arturbosch.detekt.extensions.DetektExtension> {
config = files("$rootDir/detekt.yml")
source = files("$projectDir/src")
reports {
html.enabled = true
}
}

afterEvaluate {
tasks.register<JacocoReport>("jacocoJVMTestReport") {
group = "Reporting"
Expand All @@ -61,6 +71,12 @@ allprojects {

finalizedBy("jacocoJVMTestReport")
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
}
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions buildSrc/src/main/kotlin/Libs.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
object Versions {
// Gradle plugins
const val detekt = "1.18.1"
const val dokka = "1.5.0"
const val mkdocs = "2.1.1"

// Kotlin and libs
const val kotlin = "1.4.32"
Expand Down
Loading

0 comments on commit 6fad040

Please sign in to comment.