One parameter per line if function prototype doesn't fit entirely in one line
See original GitHub issueprivate fun someMethod(
metaData: JsonNode,
interfaceIdex: Int,
registryIdex: Int
): ArrayNode? {
For this one, it should be the right format, but after I use ktfmt, it changes to
private fun getMethodsOrderedImplementationsWithMethods(
metaData: JsonNode, interfaceIdex: Int, registryIdex: Int
): ArrayNode? {
Free feel to talk to me directly via workchat wyl@fb
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
clang-format: always break all parameters, one per line
I would like my function prototypes / definitions to ...
Read more >Break long function declarations into one parameter per line
It should be doable only by modifying individual domains. A domain is given a node to render a signature into. That node is...
Read more >5.5 Function Prototypes
A function prototype is a function declaration that specifies the data types of its arguments in the parameter list. The compiler uses the...
Read more >C Programming Course Notes - Functions
Under the pass-by-value mechanism, the parameter variables within a function receive a copy of the variables ( data ) passed to them. Any...
Read more >C++ void Functions, Value and Reference Parameters, Local ...
Step 1: Add a new function "DrawCircle" to the program by writing the function definition and the function prototype. This function draws a...
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
Google’s Kotlin style guide for Android says arguments should be split across multiple lines if the function signature doesn’t fit on one line. JetBrains’ official Kotlin style guide is fuzzier; it says “closely related” arguments should be placed on the same line, but obviously ktfmt can’t determine that.
I’ll close this for now. We can revisit this if we run into examples where it’s very clearly better to break before each parameter.