is there a way to globally exclude a directory? we...
# detekt
e
is there a way to globally exclude a directory? we have some generated code checked in (yes… we know). And want to exclude that directory from contributing to score and from being formatted automatically.
e
I make my code generators emit
@file:Suppress("ALL")
👍 2
e
yeah, was also looking at that. would need to configure the apollo GQL generator to do that
t
Maybe you could put the generated code in it’s own Source Set? And exclude it by the path?
e
I was able to do it using that link above like this:
Copy code
tasks.withType(io.gitlab.arturbosch.detekt.Detekt).configureEach {
    exclude("com/example/graphql/client/**")
}
💯 2
c
It is documented here https://detekt.dev/gradle.html#leveraging-gradles-sourcetask---excluding-and-including-source-files and if baseline is used, we also need to configure
DetektCreateBaselineTask
974 Views