Set DetektJvm task source with SourceDirectorySet instead of file list#4151
Set DetektJvm task source with SourceDirectorySet instead of file list#4151chao2zhang merged 1 commit intodetekt:mainfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4151 +/- ##
============================================
- Coverage 83.45% 83.44% -0.01%
+ Complexity 3185 3177 -8
============================================
Files 463 465 +2
Lines 9095 9104 +9
Branches 1768 1775 +7
============================================
+ Hits 7590 7597 +7
- Misses 571 572 +1
- Partials 934 935 +1
Continue to review full report at Codecov.
|
|
I guess |
BraisGabin
left a comment
There was a problem hiding this comment.
Could we unit test this somehow?
I believe that's exactly the case. But this still feels like a best guess fix. Are we able to verify it somehow (unit or manual testing)? |
|
In my opinion, this fix should be in 1.19.0 - @3flex Would you have time to verify this in a repro project? I can help if you don't have time. |
|
I tested manually before submitting the PR. I'm working on adding some functional tests for the Gradle plugin but I'm finding odd issues with TestKit so it will take a bit more time to add an automated test. If anyone wants to verify manually that might be enough to get it over the line... |
|
I didn't check that the excludes work. But I tested it in my project and it doesn't introduce any regression as far as I can see. |
Fixes #4127
Unfortunately I can't say definitively why this fixes the problem, but I suspect it's somewhat related to this: gradle/gradle#3417 (comment)
Passing
kotlinSourceSet.kotlin.filespassed a list of files to use as the source for the task, whilekotlinSourceSet.kotlinpasses aSourceDirectorySet, so it's possible the filtering based on regex described in the comment I linked won't apply when a full file path is provided, but works when the source directory set is passed in instead.