kotlinter-gradle icon indicating copy to clipboard operation
kotlinter-gradle copied to clipboard

If we can support license header?

Open Goooler opened this issue 2 years ago • 4 comments

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

Goooler avatar Sep 28 '22 02:09 Goooler

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.

jeremymailen avatar Oct 03 '22 07:10 jeremymailen

Yes, that's it. But if we can support this function can just no need to keep Spotless or something else used.

Goooler avatar Oct 04 '22 09:10 Goooler

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

mateuszkwiecinski avatar Oct 09 '22 18:10 mateuszkwiecinski

Does ktlint support licence headers in any way?

AFAIK, nope. I'm also wondering if ktlint should add this support.

Goooler avatar Oct 10 '22 01:10 Goooler

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?

StylianosGakis avatar Feb 13 '23 11:02 StylianosGakis

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.

jeremymailen avatar Feb 18 '23 17:02 jeremymailen