-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add built in support for ktlint linting of gradle script kotlin files #115
Comments
This is the code that sets up the default kotlin sources. It needs tweaking for Gradle Script Kotlin, Android, and probably for kotlin-js as well. Setting the target manually is pretty easy, but we'd love a PR which improves the defaults. |
Would you like a new task added or the current one expanded? Options:
Personally, I think option 2 makes more sense as a user may have different configuration for the |
I think 2 makes the most sense. Code usually has a copyright notice at the top, and build files usually don't. |
Is there a pre-existing extension that already targets formatting groovy |
Sorry for the late response. Till now I was always able to work around the issue since the projects were using sub-projects and I have defined the formatting on all gradle files in the root project, using the |
For now, it looks like we'll have |
It is an option. It worries me that the current solution forces the user to take the restrictions imposed by Just to get a common understanding, I was more thinking about something like:
I think the Another thing I was once wondering about is how to deal with certain Java files which have a different licence but are in the same project. But I know that this is a rare scenario. Just needed it when I was patching code. |
Here is one approach to this problem. What limitations in Re: Java files within a project with a different license,
seems like a good idea to me. But I think |
But that's a matter for a new issue :) |
That would be a new issue, but quickly done. I don't think that we should explicitly exclude the license header. It is valid (and I used it for minor things) to define a plugin and/or task within a gradle file. This is when one might also have a licence. The license header is already smart enough to deal with situations where it does not find the delimiter by throwing an exception. So it avoids unintended user configuration. |
Every JavaExtension and KotlinExtension also have |
Ok, I see, my mistake. Agreed. |
Currently, the only ktlinting support is for production files.
It would be awesome if you could also configure it to lint any
.gradle.kts
files for Gradle Script KotlinThe text was updated successfully, but these errors were encountered: