Closed mekutluca closed 1 week ago
The max_line_length
setting is invalid. Use either off
or unset
as value to disable the max line length.
The
max_line_length
setting is invalid. Use eitheroff
orunset
as value to disable the max line length.
In hindsight the "solution" above is really crude. What I meant to say was that if you really want to disable the max-line-length checking, that you need to set below:
max_line_length = unset
Disabling the max-line-length
rule with ktlint_standard_max-line-length = disabled
only disables that specific rule. But any other rule that uses the property max_line_length
will not be affected by that. In this case the function-literal
rule is using the max_line_length
to decide whether it should report a violation regarding the positioning of the variables of the lambda.
The "mistake" you made is very understandable and you can not be blamed for it. Even in case it would have been documented properly (which it isn't), this misleads others as well. Ktlint should be more fault tolerant.
Every time the code is formatted with ktlint, the code block below alternates between the two states given at the
Observed Behavior
.Expected Behavior
I expect this to be accepted without raising an error.
Observed Behavior
Below code gives us the error:
Newline expected before parameter (standard:function-literal)
However, below code gives us the error:
No newline expected before parameter (standard:function-literal)
Steps to Reproduce
Example code provided above.
Your Environment
.editorconfig
settings