mirror of
https://github.com/Myxelium/Jellylink.git
synced 2026-07-07 17:55:08 +00:00
Add linter
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
plugins {
|
||||
kotlin("jvm") version "1.8.22"
|
||||
alias(libs.plugins.lavalink)
|
||||
alias(libs.plugins.detekt)
|
||||
alias(libs.plugins.ktlint)
|
||||
}
|
||||
|
||||
group = "dev.jellylink"
|
||||
@@ -22,3 +24,45 @@ java {
|
||||
kotlin {
|
||||
jvmToolchain(17)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Detekt — static analysis
|
||||
// ---------------------------------------------------------------------------
|
||||
detekt {
|
||||
config.setFrom(files("$rootDir/detekt.yml"))
|
||||
buildUponDefaultConfig = true
|
||||
allRules = false
|
||||
parallel = true
|
||||
// Exclude generated code from analysis
|
||||
source.setFrom(files("src/main/kotlin"))
|
||||
}
|
||||
|
||||
tasks.withType<io.gitlab.arturbosch.detekt.Detekt>().configureEach {
|
||||
reports {
|
||||
html.required.set(true)
|
||||
xml.required.set(false)
|
||||
txt.required.set(false)
|
||||
sarif.required.set(false)
|
||||
}
|
||||
exclude("**/generated/**")
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ktlint — formatting
|
||||
// ---------------------------------------------------------------------------
|
||||
ktlint {
|
||||
version.set("1.5.0")
|
||||
android.set(false)
|
||||
outputToConsole.set(true)
|
||||
ignoreFailures.set(false)
|
||||
filter {
|
||||
exclude("**/generated/**")
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Wire lint checks into the build lifecycle
|
||||
// ---------------------------------------------------------------------------
|
||||
tasks.named("check") {
|
||||
dependsOn("detekt", "ktlintCheck")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user