e

    Eric

    6 months ago
    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

    ephemient

    6 months ago
    I make my code generators emit
    @file:Suppress("ALL")
    e

    Eric

    6 months ago
    yeah, was also looking at that. would need to configure the apollo GQL generator to do that
    Tim Oltjenbruns

    Tim Oltjenbruns

    6 months ago
    Maybe you could put the generated code in it’s own Source Set? And exclude it by the path?
    e

    Eric

    6 months ago
    I was able to do it using that link above like this:
    tasks.withType(io.gitlab.arturbosch.detekt.Detekt).configureEach {
        exclude("com/example/graphql/client/**")
    }
    c

    chao

    6 months ago
    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