-
Notifications
You must be signed in to change notification settings - Fork 50
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
Kotlinter - configuring excluded files #242
Comments
Huh, I still haven't understood the root cause (the "the way SourceTask works is matching the package part of the path" part), but I can think of a workaround other than filtering by package:
It worked for me with apollo generated files, maybe it'll work for your case as well? 🤞 This doesn't rely on the |
Im facing the same issue
Remember this classes and folder is in the build directory, and not in the main source path EDIT: Found a solution
|
Yes the FileTreeElement is probably what you want, we do:
|
This work nicely and doesn't trigger the disabled optimization warning. |
- Fix issue #316 by upgrading kotlinter gradle's released version to ktlint 0.48.2. - Remove configuration for `disabledRules` and `experimentalRules` to fully delegate this to .editorconfig - Fix issue with resolution of rule enable / disable statements in .editorconfig - Address issue #242 by providing readme example of excluding source files at the project tree level - Address issue #314 by including sources in published artifacts - Fix issue #313 by exporting `ReporterType` - Address issue #315 by logging format log statements at level `WARNING` so they can be hidden - Credit @mateuszkwiecinski as one of the developers of the plugin
- Fix issue #316 by upgrading kotlinter gradle's released version to ktlint 0.48.2. - Remove configuration for `disabledRules` and `experimentalRules` to fully delegate this to .editorconfig - Fix issue with resolution of rule enable / disable statements in .editorconfig - Address issue #242 by providing readme example of excluding source files at the project tree level - Address issue #314 by including sources in published artifacts - Fix issue #313 by exporting `ReporterType` - Address issue #315 by logging format log statements at level `WARNING` so they can be hidden - Credit @mateuszkwiecinski as one of the developers of the plugin
Ok, one style is now documented in the readme and it seems like people have ways to target the files they want. Closing for now. |
Exclude in Kotlin Gradle: tasks.withType<LintTask> {
exclude("generated/")
}
tasks.withType<FormatTask> {
exclude("generated/")
} |
Even more DRY: import org.jmailen.gradle.kotlinter.tasks.ConfigurableKtLintTask
withType<ConfigurableKtLintTask> {
exclude("generated/")
} |
This is a follow up to the previously raised issue here - #208
The issue is it is very hard to ignore files baed on the package name. There are 2 problems with this approach:
It would be great to do a blanket exclusion of all files in the generated folder.
Would be grateful to have the below config working:
The text was updated successfully, but these errors were encountered: