kotlinter-gradle
kotlinter-gradle copied to clipboard
If we can support license header?
In some codebases, we were migrating from Spotless to Kotlinter, but still need Spotless to add license headers for kt files, if Kotlinter can support it we'll finally get rid of Spotless.
https://github.com/diffplug/spotless/tree/main/plugin-gradle#license-header
There are a few good license management gradle plugins out there including this one: https://github.com/hierynomus/license-gradle-plugin
I feel like the functionality is rich enough and enough of a separate concern to warrant a separate plugin.
Yes, that's it. But if we can support this function can just no need to keep Spotless or something else used.
Does ktlint
support licence headers in any way?
I'm not sure that we'd can/want to add support for such on a Gradle Plugin side. Its primary purpose is to serve as a Gradle wrapper for ktlint
(The plugin doesn't process files on their own. They are listed and then sent to ktlint
, re-routing its output to Gradle console)
If you believe such functionality should exist, it would probably have to be implemented on the ktlint
side before kotlinter could support such, but as Jeremy said - this feels like a completely separate plugin
Does ktlint support licence headers in any way?
AFAIK, nope. I'm also wondering if ktlint should add this support.
Have you taken this discussion to maintainers of ktlint itself? Have they shared their opinions on the idea that ktlint itself can support header files?
We haven't -- feel free to do so, but it really does seem like a separate plugin and out of scope. There are a lot of considerations and configurations regarding licensing and compliance with that and this plugin does not pretend to be expert in those considerations. We handle the formatting of code files.
For now I'm closing this as out of scope.