Closing parentheses placement for method calls does not match Kotlin style guide
See original GitHub issueThis came up in #10, but IIUC the changes made in that issue were only for method declarations, not method calls.
See e.g. https://kotlinlang.org/docs/reference/coding-conventions.html#method-call-formatting:
drawSquare(
x = 10, y = 10,
width = 100, height = 100,
fill = true
)
One reason this might be worth reconsidering is the support for trailing commas that was added in Kotlin 1.4 (see KT-9476), which will allow writing:
drawSquare(
x = 10, y = 10,
width = 100, height = 100,
- fill = true
+ fill = true,
)
Leaving the closing paren )
on the previous line seems like bad style:
drawSquare(
x = 10, y = 10,
width = 100, height = 100,
fill = true,)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:10 (8 by maintainers)
Top Results From Across the Web
Closing parentheses placement for method calls does not match ...
At Google, we are using the first option (all parameters on separate lines, closing parens on its own line). This is also the...
Read more >Coding conventions | Kotlin
Commonly known and easy-to-follow coding conventions are vital for any programming language. Here we provide guidelines on the code style ...
Read more >Kotlin style guide | Android Developers
Braces follow the Kernighan and Ritchie style ("Egyptian brackets") for nonempty blocks and block-like constructs: No line break before the opening brace. Line ......
Read more >Check for Balanced Brackets in an expression (well ...
Given an expression string, write a program to examine whether the pairs and the orders of parentheses are balanced in expression or not....
Read more >Code Style. Java | IntelliJ IDEA Documentation - JetBrains
In this field, specify the number of spaces to be inserted between the elements of an array, in expressions, method declarations and method...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
My vote is a new line, wasting the vertical space. IMO the consistency is what I value.
@JavierSegoviaCordoba I’m hesitant to introduce special formatting cases such as builder patterns. First, because I’m concerned it’ll complicate the code and make it less maintainable, and second because it might be difficult to correctly identify the pattern.