Closed szedelenyi closed 6 months ago
Tnx for reporting. This is a bug indeed.
For now you can suppress this as follows:
@Suppress("ktlint:standard:function-signature")
private fun buildSelectQuery(additionalWhereClause: String = "") =
"""
SELECT
$ID,
$CREATED_AT,
$CREATED_BY,
$DELETED,
$STATE
FROM $SESSIONS
WHERE $ID = :$ID
AND $DELETED = false
$additionalWhereClause
""".trimIndent()
Thanks, that's what I did already, but I thought it's worth flagging.
Expected Behavior
Given the following config:
And the following code:
I would expect that the
function-signature
rule is ignored and thestring-template-indent
rule takes precedence. (Alternativelystring-template-indent
is ignored, but I feel thatstring-template-indent
should take precedence.)Observed Behavior
ktlint cannot format the given code, as it either violates
function-signature
orstring-template-indent
.Steps to Reproduce
Run
ktlint --format
on the given snippet.Your Environment
.editorconfig
settingsktlint_function_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than = unset ktlint_function_signature_body_expression_wrapping = default
as function signature body expression wrapping is set to
default
instead ofmultiline
,then it would be inconsistent to enable multiline expression wrapping
ktlint_standard_multiline-expression-wrapping = disabled