detekt / sonar-detekt

SonarQube plugin for Kotlin
https://detekt.dev
GNU Lesser General Public License v3.0
493 stars 52 forks source link

Add KotlinClasspath to detect .class files generated from .kt #77 #79

Closed kzaikin closed 6 years ago

kzaikin commented 6 years ago

jacoco coverage was not detected for .kt files as plugin was using JavaClasspath for coverage detection. As a result, only .class files produced from .java files were used in detection of test coverage. Here I introduce a hack, where I add a path with .class files from libraries to binaries for analysis.

kzaikin commented 6 years ago

I have checked the proposed hack at a large-scale Android project with both .java and .kt in production code and both .java and .kt in test code.

robinvanb commented 6 years ago

This is exactly what I'm looking for! I've configured my Kotlin application to generate coverage reports but Sonar won't pick them up

arturbosch commented 6 years ago

Hey just tested it on sonar-kotlin itself and it works, thanks for contributing!

robinvanb commented 6 years ago

Awesome stuff, any idea when this will be available in the plugin from the marketplace?

arturbosch commented 6 years ago

The plugin from the marketplace should be the offical kotlin plugin from sonarsource. This is an unofficial based on detekt and can just be downloaded via the github releases page. the newest version, 0.5.1, have this changes and is based on detekt RC9.2