mirror of
https://github.com/mihonapp/mihon.git
synced 2025-06-25 10:37:51 +02:00
Create plugin for linting (#8942)
This commit is contained in:
@ -3,12 +3,14 @@ plugins {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinLibs.versions.kotlin.version.get()}")
|
||||
|
||||
implementation(androidxLibs.gradle)
|
||||
implementation(kotlinLibs.gradle)
|
||||
implementation(libs.kotlinter)
|
||||
implementation(gradleApi())
|
||||
}
|
||||
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
|
@ -1,5 +1,11 @@
|
||||
dependencyResolutionManagement {
|
||||
versionCatalogs {
|
||||
create("libs") {
|
||||
from(files("../gradle/libs.versions.toml"))
|
||||
}
|
||||
create("androidxLibs") {
|
||||
from(files("../gradle/androidx.versions.toml"))
|
||||
}
|
||||
create("kotlinLibs") {
|
||||
from(files("../gradle/kotlinx.versions.toml"))
|
||||
}
|
||||
|
20
buildSrc/src/main/kotlin/tachiyomi.lint.gradle.kts
Normal file
20
buildSrc/src/main/kotlin/tachiyomi.lint.gradle.kts
Normal file
@ -0,0 +1,20 @@
|
||||
import org.jmailen.gradle.kotlinter.KotlinterExtension
|
||||
import org.jmailen.gradle.kotlinter.KotlinterPlugin
|
||||
|
||||
apply<KotlinterPlugin>()
|
||||
|
||||
extensions.configure<KotlinterExtension>("kotlinter") {
|
||||
experimentalRules = true
|
||||
|
||||
disabledRules = arrayOf(
|
||||
"experimental:argument-list-wrapping", // Doesn't play well with Android Studio
|
||||
"filename", // Often broken to give a more general name
|
||||
)
|
||||
}
|
||||
|
||||
tasks {
|
||||
named<DefaultTask>("preBuild").configure {
|
||||
if (!System.getenv("CI").toBoolean())
|
||||
dependsOn("formatKotlin")
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user