KyoriPowered / indra

A set of Gradle plugins to apply common organization build settings.
MIT License
31 stars 6 forks source link

`indra-licenser-spotless` doesn't work with Ktlint #136

Closed phinner closed 1 year ago

phinner commented 1 year ago

For some reason, when you use the spotless plugin alongside Indra and that you use Ktlint for formatting, the license header is not applied in the source files. Here is a test build.gradle.kts to reproduce this issue.

plugins {
    kotlin("jvm") version "1.8.21"
    id("com.diffplug.spotless") version "6.19.0"
    id("net.kyori.indra.licenser.spotless") version "3.1.1"
}

group = "org.example"
version = "1.0-SNAPSHOT"

repositories {
    mavenCentral()
}

dependencies {
    implementation(kotlin("stdlib"))
}

spotless {
    kotlin {
        ktlint()
    }
    kotlinGradle {
        ktlint()
    }
}

indraSpotlessLicenser {
    licenseHeaderFile(rootProject.file("HEADER.md"))
}

kotlin {
    jvmToolchain(17)
}
zml2008 commented 1 year ago

This happens with spotless's license header step and ktlint upstream too, please report to them.