https://kotlinlang.org logo
#detekt
Title
p

PJ Walstrom

06/13/2022, 7:12 AM
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
Copy code
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

06/13/2022, 8:07 AM
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
p

PJ Walstrom

06/13/2022, 9:10 AM
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!
Copy code
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.20.0")
👍 1
g

gammax

06/13/2022, 1:18 PM
I'd suggest you don't use the Github Action but rather add a step where you just invoke Gradle
detekt
or so.
5 Views