kotlinter-gradle: Kotlinter is not ignoring generated files
I have several generated kotlin files in my app (inside a build
directory) which creates kotlin code that ktlint
doesnt like. Since I have no control over the code generation and it is not being checked into git I would like ktlint to ignore the files within the build
directory.
I tried adding several variations of exclude("build/**")
but each time ktlint was failing on the generated files. Is there any way to ignore the build
directory?
Note: I added the exclude directory to "lintKotlinMain"(org.jmailen.gradle.kotlinter.tasks.LintTask::class) {
as stated in the README
Thanks so much!
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 28 (14 by maintainers)
Commits related to this issue
- Clarify task exclude documentation Address #208. — committed to jeremymailen/kotlinter-gradle by jeremymailen 3 years ago
- Clarify task exclude documentation (#213) Address #208. — committed to jeremymailen/kotlinter-gradle by jeremymailen 3 years ago
Could you explain how you make it work? Im facing the same issue, Im using a code generator plugin for my Graphql API (DGS codegen from netflix) and everything in goes into the /build/generated path outside the main project, and I cant make it work to ignore it, with ktlint gradle it works like a charm doing this:
But with this plugin it doesnt work at all
We need a standard way to fix this problem…This issue must be open.
EDIT: Found a solution
Yes, will add it as an enhancement request. The Gradle Quality plugin has a similar extra param
excludeSources
http://xvik.github.io/gradle-quality-plugin/4.6.0/guide/exclusion/