You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When applying Detekt on a KMP project, with commonMain and jvmMain source sets, the task detektJvmMain should apply rule detection to all source files contributing to the JVM target, that is, both commonMain and jvmMain.
Observed Behavior
In the case mentionned above, the task detektJvmMain only applies rule detection to the kotlin files in the jvmMain source set, but not the shared files from the commonMain source set.
Steps to Reproduce
Project
Sample project attached : sample.zip.
If not available, just create a simple new KMP project with the following files:
3flex
changed the title
Running detekt on JVM target (in KMP project) doesn't run against the commoon source set
Running detekt on JVM target (in KMP project) doesn't run against the common source set
Jun 10, 2024
Expected Behavior
When applying Detekt on a KMP project, with
commonMain
andjvmMain
source sets, the taskdetektJvmMain
should apply rule detection to all source files contributing to the JVM target, that is, bothcommonMain
andjvmMain
.Observed Behavior
In the case mentionned above, the task
detektJvmMain
only applies rule detection to the kotlin files in thejvmMain
source set, but not the shared files from thecommonMain
source set.Steps to Reproduce
Project
Sample project attached : sample.zip.
If not available, just create a simple new KMP project with the following files:
build.gradle.kts
src/commonMain/kotlin/CommonClass.kt
src/jvmMain/kotlin/JvmClass.kt
Reproduction test
detektMetadataMain
gradle taskCommonClass
(i.e.:Variable names should match the pattern: [a-z][A-Za-z0-9]* [VariableNaming]
)detektJvmMain
gradle taskJvmClass
(at least:Variable names should match the pattern: [a-z][A-Za-z0-9]* [VariableNaming]
)Context
Some of our custom rules rely on type resolution which is only availbale when running against the JVM target.
Your Environment
--scan
option when running the gradle task): https://gradle.com/s/u467js5p4dob2The text was updated successfully, but these errors were encountered: