Skip to content

ExplicitCollectionElementAccessMethod rule update#5654

Merged
BraisGabin merged 5 commits into
detekt:mainfrom
atulgpt:fix-5640
Jan 12, 2023
Merged

ExplicitCollectionElementAccessMethod rule update#5654
BraisGabin merged 5 commits into
detekt:mainfrom
atulgpt:fix-5640

Conversation

@atulgpt

@atulgpt atulgpt commented Dec 31, 2022

Copy link
Copy Markdown
Contributor

Fixes #5640

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
@vercel

vercel Bot commented Dec 31, 2022

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
detekt 🔄 Building (Inspect) Jan 2, 2023 at 0:02AM (UTC)

Co-authored-by: Brais Gabín <braisgabin@gmail.com>
@github-actions

github-actions Bot commented Jan 2, 2023

Copy link
Copy Markdown
Warnings
⚠️ This PR is approved with no milestone set. If merged, it won't appear in the Detekt release notes.

Generated by 🚫 dangerJS against f9a6d58

return function.isOperator
}

@Suppress("ReturnCount")

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Contributor Author

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

@atulgpt

atulgpt commented Jan 5, 2023

Copy link
Copy Markdown
Contributor Author

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?

@BraisGabin BraisGabin merged commit e152f88 into detekt:main Jan 12, 2023
@BraisGabin BraisGabin added this to the 1.23.0 milestone Jan 12, 2023
@atulgpt atulgpt deleted the fix-5640 branch May 1, 2023 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False positive on ExplicitCollectionElementAccessMethod with spread operator

3 participants