pinterest / ktlint

An anti-bikeshedding Kotlin linter with built-in formatter
https://pinterest.github.io/ktlint/
MIT License
6.19k stars 505 forks source link

A line only containing a string and a trailing comma should not be reported to exceed max line length #2597

Closed paul-dingemans closed 6 months ago

paul-dingemans commented 6 months ago

A line containing a string and a trailing comma should not be reported to exceed max line length as. See example below:

throw SomeException(
    "A long exception message which exceeds the maximum line length and is followed by a (trailing) comma",
    e,
)
// or
throw SomeException(
    "A long exception message which exceeds the maximum line length and is followed by a (trailing) comma",
)

2480 does not report string template when it is the only element on the line. But is that string template is followed by a comma, it is still reported.

Originally posted by @paul-dingemans in https://github.com/pinterest/ktlint/issues/2480#issuecomment-1984318663