Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Add ability to exclude paths from analysis #31

Merged
merged 1 commit into from
Dec 22, 2020
Merged

Conversation

3flex
Copy link
Member

@3flex 3flex commented Dec 21, 2020

Allows filtering of paths so they're excluded from analysis. By default it excludes the build directory which is where all generated files should be created, so it will ignore anything created by kapt, sqldelight etc as mentioned in #10 (comment).

There's a bit of a hacky workaround to get a list of glob patterns passed cleanly to the compiler plugin, which only accepts strings as input. Because the glob patterns could theoretically contain any character it didn't make sense to me to allow e.g. a comma-separated list of values, because the glob patterns themselves could include commas (or any other character you might use as a separator). The solution I used is to serialize the list before passing to the compiler plugin where it's deserialized so it's safe. This is transparent for anyone using the Gradle plugin which should be 99% of users.

This is what's done for some kapt compiler plugin options as well.

Closes #10

Copy link
Member

@schalkms schalkms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool!

@3flex 3flex merged commit aeaea39 into detekt:master Dec 22, 2020
@3flex 3flex deleted the filters branch December 22, 2020 23:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't analyse Kotlin files generated by kapt
2 participants