Skip to content
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

Don't report when entries with multiple conditions and trailing comma #28

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

AfzalivE
Copy link
Member

@AfzalivE AfzalivE commented Sep 12, 2024

Update to ConsistentWhenEntries rule to allow when-blocks with multiple conditions in one when-entry with trailing commas.

Before, this was invalid but should be valid.

val a = listOf<Int>()
val b = when(a) {
    is ArrayList,
    is MutableList,
    -> true
    else -> false
}

Before, this was valid but should be invalid.

val a = listOf<Int>()
val b = when(a) {
    is ArrayList,
    is MutableList,
    -> {
        true
    }
    else -> false
}

@AfzalivE AfzalivE requested review from a team and rastislavvasko and removed request for a team September 12, 2024 23:46
Copy link
Member

@rastislavvasko rastislavvasko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! 👌

@AfzalivE AfzalivE force-pushed the afzal/fix.consistent_when_multiline branch from f214300 to a6c563a Compare September 13, 2024 14:16
@AfzalivE
Copy link
Member Author

Thanks for the review!

@AfzalivE AfzalivE merged commit 96b85af into main Sep 13, 2024
4 checks passed
@AfzalivE AfzalivE deleted the afzal/fix.consistent_when_multiline branch September 13, 2024 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants