-
-
Notifications
You must be signed in to change notification settings - Fork 778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UnusedPrivateMember - added handling of overloaded array get operator… #3666
UnusedPrivateMember - added handling of overloaded array get operator… #3666
Conversation
this.firstOrNull { it.s == s } | ||
} | ||
""" | ||
assertThat(subject.compileAndLintWithContext(env, code)).hasSize(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add one test that shows that reports if it's not used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Good call. Totally forgot about it.
...t-rules-style/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnusedPrivateMember.kt
Outdated
Show resolved
Hide resolved
4a531f7
to
e4ade96
Compare
Codecov Report
@@ Coverage Diff @@
## main #3666 +/- ##
============================================
+ Coverage 83.48% 83.49% +0.01%
- Complexity 3159 3160 +1
============================================
Files 458 458
Lines 9047 9048 +1
Branches 1759 1760 +1
============================================
+ Hits 7553 7555 +2
- Misses 567 568 +1
+ Partials 927 925 -2
Continue to review full report at Codecov.
|
e4ade96
to
0088c54
Compare
...les-style/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnusedPrivateMemberSpec.kt
Outdated
Show resolved
Hide resolved
6116def
to
e6e9904
Compare
...les-style/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnusedPrivateMemberSpec.kt
Show resolved
Hide resolved
@@ -44,6 +45,8 @@ import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall | |||
import org.jetbrains.kotlin.types.expressions.OperatorConventions | |||
import org.jetbrains.kotlin.util.OperatorNameConventions | |||
|
|||
private const val ARRAY_GET_METHOD_NAME = "get" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the set
operator be tracked as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be done in a follow up PR (if someone wants to do it)
...les-style/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/style/UnusedPrivateMemberSpec.kt
Show resolved
Hide resolved
Friendly ping to get the status of this PR @DcortezMeleth If you need further support, let us know 👍 I also stumbled upon this same false positive in another project: https://github.com/cortinico/ktfmt-gradle/pull/32/files#diff-c3cf3f82913f1a5c2d33bd9b78e2b8cfcb4adbf4c82103d773017f79ed3334ae |
e6e9904
to
8160568
Compare
I rebased the commit to fix the conflicts and added the missing test that @cortinico talk about. |
8160568
to
1785a15
Compare
… method (#3640)
PR with changes removing UnusedPrivateMember rule false positives regarding overloaded array get operator method.