PJ Walstrom

    PJ Walstrom

    3 months ago
    Hello there, we are running detekt as a plugin in our gradle-build, and also as a GitHub Action. Both are using the same configuration file. At least we hope they do 😅 Nonetheless, the local build fails with
    DataSource.kt:23:1: Unexpected indentation (20) (should be 16) [Indentation]
    Whereas the GHA-variant runs ok. Any suggestions to why? We are using the 1.20.0 version of the gradle plugin, and also the 1.20.0 version of the GHA. Any help would be highly appreciated 🙂
    b

    Brais Gabin

    3 months ago
    I don't know how the Github action works exactly but it seems that you are using the formatting plugin in local but you aren't using it on the Github Action
    PJ Walstrom

    PJ Walstrom

    3 months ago
    aah, yes, that is probably it. GHA only uses the static code analysis part, whereas the following from build.gradle.kts also includes the formatting. Thanks!
    detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.20.0")
    gammax

    gammax

    3 months ago
    I'd suggest you don't use the Github Action but rather add a step where you just invoke Gradle
    detekt
    or so.