Short implementations of functional interfaces could be on a single line
- Dominant language
- Kotlin
- Stars
- 1.3k
- Forks
- 116
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 15
Description
Actual:
```kotlin
fun interface VeryVeryLongCustomInterface {
fun function(options: Options): EndResult
}
val EMPTY_VERY_VERY_LONG_CUSTOM_INTERFACE: VeryVeryLongCustomInterface =
VeryVeryLongCustomInterface {
EndResult
}
```
Preferable, perhaps?
```kotlin
val EMPTY_VERY_VERY_LONG_CUSTOM_INTERFACE: VeryVeryLongCustomInterface =
VeryVeryLongCustomInterface { EndResult }
```
Contributor guide
Research direction
Start by locating the formatter logic and tests that handle Kotlin functional-interface implementations and single-expression lambdas. Compare the actual and preferable examples in the issue, then add coverage showing that the short implementation is kept on one line when appropriate. Done means the formatter produces the requested compact output without regressing related formatting cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100