ktlint appears to be reading from the File not the String (original) (raw)

This issue is present in only Kotlin/Kotlin (Gradle) file source sets that I know of with the ktlint formatter.

When a source file is changed, the license doesn't reflect the changes and marks the file as an OK state, which should update the license content if it was changed.

A reproduction repository can be seen in auguwu/spotless-kotlin/repro. Just run ./gradlew spotlessApply.

Expected Result

/**

import kotlin.TODO

fun main(args: Array) { println(

    "we do a little" +

        "trolling",
)

TODO("this function is a work in progress!")

}

Actual Result

import kotlin.TODO

fun main(args: Array) { println(

    "we do a little" +

        "trolling",
)

TODO("this function is a work in progress!")

}