Check for static imports in unused imports rule#3188
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3188 +/- ##
============================================
+ Coverage 79.55% 79.57% +0.01%
Complexity 2631 2631
============================================
Files 440 440
Lines 7964 7969 +5
Branches 1521 1522 +1
============================================
+ Hits 6336 6341 +5
Misses 818 818
Partials 810 810
Continue to review full report at Codecov.
|
594ef8b to
9737886
Compare
9737886 to
d6ef885
Compare
|
When I run the task |
|
Use Compile all the snippets each time that we run the tests slow down the test and is kind of meta testing (testing the tests). For that reason we have the compilation disabled by default and we just compile them in CI.
|
| val mainFile = """ | ||
| import x.y.z.Foo | ||
|
|
||
| val x = Foo.LAZY | ||
| """ | ||
| val additionalFile = """ | ||
| package x.y.z | ||
|
|
||
| enum class FetchType { | ||
| LAZY | ||
| } |
There was a problem hiding this comment.
Why does this compile? the enum is called FetchType but the import is for Foo 🤔
There was a problem hiding this comment.
I wrote the tests with Foo and later renamed them before committing to mimic the issue reported. However, your point of compilation seems to be valid 😮
There was a problem hiding this comment.
@schalkms do you have any idea about why does this happen? This doesn't stop the PR but I will like to know why does this happen
There was a problem hiding this comment.
@BraisGabin Yes, I do. Please take a look at the following lines and closely check line number 68.
* Check for static imports in unused imports rule * Fix test compilation * Fix test variable names
* Check for static imports in unused imports rule * Fix test compilation * Fix test variable names
* Check for static imports in unused imports rule * Fix test compilation * Fix test variable names
Fixes #3131