Repository navigation
Add multiline-loop to complement multiline-if-else - #2298
Conversation
|
Tnx for your contribution. I will have a look after |
|
Hi Paul. I understand, thanks for your response. And also for pointing out the bracing difference between Kotlin and Android style guides. |
paul-dingemans
left a comment
There was a problem hiding this comment.
Well done! I see that you picked up quite some conventions of the project. Please address the remarks.
| for (i in 1..10) return 0 | ||
| while (true) return 0 | ||
| do return 0 while (true) |
There was a problem hiding this comment.
According to Android style guide:
Braces are otherwise required for any if, for, when branch, do, and while statements and expressions, even when the body is empty or contains only a single statement.
Kotlin style guide does not mention it explicitly, but I am fine with imposing this on code styles.
Description
Related to #2223.
Added
MultiLineLoopRulethat, likeMultiLineIfElseRule, checks violation infor,while, anddostatements.Checklist
Before submitting the PR, please check following (checks which are not relevant may be ignored):
Closes #<xxx>orFixes #<xxx>(replace<xxx>with issue number)CHANGELOG.mdis updatedDocumentation is updated. See difference between snapshot and release documentation