Hello!
There seems to be an off-by-one error when using Google-style and trailing commas. I just tried out the Google Style with trailing commas and saw the following scenario:
@Test
fun testShowBillingErrorPaymentButton() =
composeExtension.use {
// Arrange
setContentWithTheme {
AccountScreen(
state =
AccountUiState.default()
.copy(billingPaymentState = PaymentState.Error.Billing),
uiSideEffect = MutableSharedFlow<AccountViewModel.UiSideEffect>().asSharedFlow(),
)
}
// Assert
onNodeWithText("Add 30 days time").assertExists()
}
The line:
uiSideEffect = MutableSharedFlow<AccountViewModel.UiSideEffect>().asSharedFlow(),
ends up being 101 characters even though I set maxWidth to 100.
If i change the named parameter to uiSideEffects, we see the following behavior, where it correctly wraps the line:
@Test
fun testShowBillingErrorPaymentButton() =
composeExtension.use {
// Arrange
setContentWithTheme {
AccountScreen(
state =
AccountUiState.default()
.copy(billingPaymentState = PaymentState.Error.Billing),
uiSideEffects =
MutableSharedFlow<AccountViewModel.UiSideEffect>().asSharedFlow(),
)
}
// Assert
onNodeWithText("Add 30 days time").assertExists()
}
My configuration is as follows:
configure<com.ncorti.ktfmt.gradle.KtfmtExtension> {
googleStyle()
blockIndent.set(4)
continuationIndent.set(4)
maxWidth.set(100)
removeUnusedImports.set(true)
}
Hello!
There seems to be an off-by-one error when using Google-style and trailing commas. I just tried out the Google Style with trailing commas and saw the following scenario:
The line:
uiSideEffect = MutableSharedFlow<AccountViewModel.UiSideEffect>().asSharedFlow(),ends up being 101 characters even though I set maxWidth to 100.
If i change the named parameter to
uiSideEffects, we see the following behavior, where it correctly wraps the line:My configuration is as follows: