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

Janusz Chorko

02/02/2022, 4:42 PM
I just noticed that detekt does not analyse sources in kotlin subdirectory of android variant (even with detektVariant2Debug task):
Copy code
src
├── variant1
│   └── java
│       └── files here are processed
├── main
│   └── java
│       └── files here are processed
└── variant2
    └── kotlin
        └── files here are ignored
If I rename sources directory to java it reports issues in those files. I'm not specifying any custom source directories in my build scripts. Does detekt use only java sources instead of kotlin sources? AGP sourceSets task reports java subdir in java sources and both in kotlin sources:
Copy code
Java sources: [module1\src\variant2Debug\java]
Kotlin sources: [module1\src\variant2Debug\kotlin, module1\src\variant2Debug\java]
b

Brais Gabin

02/02/2022, 5:03 PM
How are you running detekt? gradle? If so, which task do you use?
j

Janusz Chorko

02/02/2022, 5:04 PM
tried both detekt and detektVariant2Debug
b

Brais Gabin

02/02/2022, 5:04 PM
That seems like a bug
Could you open an issue?
j

Janusz Chorko

02/02/2022, 5:06 PM
might be something with AGP changes - I've noticed it on 7.0.4 and just updated to 7.1.0
b

Brais Gabin

02/02/2022, 5:06 PM
It shouldn't but maybe. We should support those two.
j

Janusz Chorko

02/02/2022, 5:11 PM
I'll check if it happens on new minimal project and report a bug if so
❤️ 2
g

gammax

02/02/2022, 6:43 PM
That would be gold ☝️
3 Views