Skip to content

Commit

Permalink
Fix documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-dingemans committed Oct 4, 2024
1 parent bbcb744 commit 2e9dbb0
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions documentation/snapshot/docs/rules/standard.md
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ Enforces the parameters of a function literal and the arrow to be written on the

If the function literal contains multiple parameters and at least one parameter other than the first parameter starts on a new line than all parameters and the arrow are wrapped to separate lines.

=== "[:material-heart:](#) Ktlint"
=== "[:material-heart:](#) Ktlint (ktlint_official)"

```kotlin
val foobar1 = { foo + bar }
Expand All @@ -775,6 +775,27 @@ If the function literal contains multiple parameters and at least one parameter
foo + bar
}
val foobar5 = { foo: Foo, bar: Bar -> foo + bar }
val foobar6 =
{
foo: Foo,
bar: Bar,
->
foo + bar
}

// Assume that the last allowed character is
// at the X character on the right X
val foobar7 =
barrrrrrrrrrrrrr {
fooooooooooooooo: Foo
->
foo.repeat(2)
}
```

=== "[:material-heart:](#) Ktlint (non ktlint_official)"

```kotlin
val foobar6 =
{
foo: Foo,
Expand All @@ -787,7 +808,7 @@ If the function literal contains multiple parameters and at least one parameter
// at the X character on the right X
val foobar7 =
barrrrrrrrrrrrrr {
fooooooooooooooo: Foo
fooooooooooooooo: Foo
->
foo.repeat(2)
}
Expand Down

0 comments on commit 2e9dbb0

Please sign in to comment.