-
-
Notifications
You must be signed in to change notification settings - Fork 797
ExplicitCollectionElementAccessMethod rule update #5654
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
Conversation
Fix false positive in ExplicitCollectionElementAccessMethod by checking if any parameter(excluding the first) is spread parameter if yes then return false as we can use access method syntax with spread parameter
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
...main/kotlin/io/gitlab/arturbosch/detekt/rules/style/ExplicitCollectionElementAccessMethod.kt
Outdated
Show resolved
Hide resolved
.../kotlin/io/gitlab/arturbosch/detekt/rules/style/ExplicitCollectionElementAccessMethodSpec.kt
Outdated
Show resolved
Hide resolved
Co-authored-by: Brais Gabín <braisgabin@gmail.com>
...main/kotlin/io/gitlab/arturbosch/detekt/rules/style/ExplicitCollectionElementAccessMethod.kt
Outdated
Show resolved
Hide resolved
.../kotlin/io/gitlab/arturbosch/detekt/rules/style/ExplicitCollectionElementAccessMethodSpec.kt
Outdated
Show resolved
Hide resolved
@@ -96,6 +100,7 @@ class ExplicitCollectionElementAccessMethod(config: Config = Config.empty) : Rul | |||
return function.isOperator | |||
} | |||
|
|||
@Suppress("ReturnCount") |
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.
Why is this suppress needed? It wasn't needed before and you didn't add any new code to this function
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.
It was already giving the warning as it has three return
statements(while only 2 are allowed). I suppressed the warning
Hi, @BraisGabin/ @cortinico this is good for a merge if we can close the comment thread at #5654 (comment). Also, want to know what is the process of the merge. Will one of the maintainers be merging this PR or if approved, the author can merge it? |
Fixes #5640