Closed lonewolf2208 closed 2 months ago
.editorconfig
setting ktlint_standard_max-line-length = disabled
only results in disabling the max-line-length
rule.
In the output of Ktlint CLI you can see that the error is caused by property-wrapping
rule:
Missing newline before "SaveFeedbackInteractionLoanApplicationIdUseCase" (standard:property-wrapping)
Missing newline before "GetFeedbackInteractionLoanApplicationIdUseCase" (standard:property-wrapping)
By using ktlint_code_style
set to android
the max_line_length
property is set by default to 100
. Disabling ktlint_standard_max-line-length
does not change that value. This value is used by multiple rules. To fully disable all length line checks, you can set max_line_length
to value unset
.
Thanks @paul-dingemans for the input . Can we disbale the standard:property-wrapping
rule ?
I tried to disable it using ktlint_standard_property-wrapping = disabled
.
Thanks @paul-dingemans for the input . Can we disbale the
standard:property-wrapping
rule ? I tried to disable it usingktlint_standard_property-wrapping = disabled
.
Sure, but the better solution would be to configure it in .editorconfig
:
root = true
[*.{kt,kts}]
max_line_length = unset
Reason for this is that more rules look at the max_line_length
property.
OP has not responded. Issue is considered resolved with solution given above.
Expected Behavior
The ktlint Check should pass for the variable declaration like given below (given that I have disabled
ktlint_standard_max-line-length = disabled
in the .editorconfig file ) -private val saveFeedbackInteractionLoanApplicationIdUseCase: SaveFeedbackInteractionLoanApplicationIdUseCase, private val getFeedbackInteractionLoanApplicationIdUseCase: GetFeedbackInteractionLoanApplicationIdUseCase
Observed Behavior
Failing getting the error. -
Missing newline before "SaveFeedbackInteractionLoanApplicationIdUseCase"
Missing newline before "GetFeedbackInteractionLoanApplicationIdUseCase"
Other cases where it is failing. -
private val getSecondaryButtonFromLendingAccountDetailsUseCase: GetSecondaryButtonFromLendingAccountDetailsUseCase
private val isBiometricEnrollmentAttemptWithinLimitUseCase: IsBiometricEnrollmentAttemptWithinLimitUseCase
Your Environment
.editorconfig
settings : ktlint_code_style = android_studioWork Around
Changing variable names to a shorter one