jeremymailen / kotlinter-gradle

Painless, fast ktlint plugin for Gradle

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

kotliner configuration issue with using "subproject" in Kotlin DSL / Gradle

Eightyplus opened this issue · comments

I'm converting some build files in Grovy to KTS, and somehow the kotliner configuration does not work for subproject. It worked in Grovy. Is it still possible to do this or do I need to move this into every module build script?

Screenshot 2023-11-17 at 10 44 52

Solved it by extracting setup to gradle file 😢

apply(from = rootProject.file("kotliner.gradle"))

subprojects {
    apply plugin: "org.jmailen.kotlinter"

    kotlinter {
        ignoreFailures = false
        reporters = ['checkstyle', 'plain', 'html']
        disabledRules = ['trailing-comma-on-call-site', 'trailing-comma-on-declaration-site']
    }
}

found yet another solution 🤦

subprojects {
    apply(plugin = "org.jmailen.kotlinter")

    configure<KotlinterExtension> {
        ignoreFailures = false
        reporters = arrayOf("checkstyle", "plain", "html")
        disabledRules = arrayOf("trailing-comma-on-call-site", "trailing-comma-on-declaration-site")
    }
}