Skip to content

Commit ae88297

Browse files
committed
added Detekt check
1 parent 72b26e9 commit ae88297

File tree

8 files changed

+128
-141
lines changed

8 files changed

+128
-141
lines changed

.github/workflows/build.yml

+18
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,24 @@ permissions:
2020
id-token: write
2121

2222
jobs:
23+
detekt:
24+
runs-on: ubuntu-latest
25+
26+
steps:
27+
- name: Clone repo
28+
uses: actions/checkout@v3
29+
with:
30+
fetch-depth: 1
31+
ref: ${{ github.head_ref }}
32+
33+
- name: Setup detekt
34+
uses: peter-murray/setup-detekt@v2
35+
with:
36+
detekt_version: 1.22.0
37+
38+
- name: Run detekt
39+
run: detekt-cli -c gradle/detekt/detekt.yml
40+
2341
build:
2442

2543
runs-on: ubuntu-latest

build.gradle.kts

+15
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import io.gitlab.arturbosch.detekt.Detekt
12
import org.jetbrains.kotlin.gradle.targets.js.yarn.yarn
23
import java.util.*
34

45
plugins {
56
kotlin("multiplatform") version "1.8.20"
67
//id("dev.petuska.npm.publish") version "2.1.1"
8+
id("io.gitlab.arturbosch.detekt").version("1.23.0-RC2")
79
id("org.jetbrains.dokka") version "1.8.10"
810
id("org.jetbrains.kotlinx.kover") version "0.6.1"
911
id("maven-publish")
@@ -224,3 +226,16 @@ koverMerged {
224226
}
225227
enable()
226228
}
229+
230+
detekt {
231+
buildUponDefaultConfig = true // preconfigure defaults
232+
allRules = false // activate all available (even unstable) rules.
233+
config.setFrom("$projectDir/gradle/detekt/detekt.yml") // point to your custom config defining rules to run, overwriting default behavior
234+
// baseline = file("$projectDir/config/baseline.xml") // a way of suppressing issues before introducing detekt
235+
}
236+
237+
tasks.withType<Detekt>().configureEach {
238+
reports {
239+
html.required.set(true) // observe findings in your browser with structure and code snippets
240+
}
241+
}

0 commit comments

Comments
 (0)