From d72a3c2be42ccdcea62102fdf10f1c8f65d95990 Mon Sep 17 00:00:00 2001 From: stylianosgakis Date: Thu, 3 Sep 2026 10:30:16 +0200 Subject: [PATCH] chore: fix the ktlint failures already present on develop `./gradlew ktlintCheck` fails on develop in two modules, 37 errors, none of them related to any in-flight work. Left alone it is a trap: any PR that touches ktlint config looks like it broke CI when it did not. YourInfoTab.kt is purely `formatKotlin` output: an if/else given braces and a newline, and a function signature collapsed onto one line. TerminationRedirectionDestination.kt needed a manual fix, since standard:max-line-length is not auto-fixable. The same 127 character description string appears in two previews and is now split across two literals. --- .../insurancedetail/yourinfo/YourInfoTab.kt | 65 +++++++++---------- .../TerminationRedirectionDestination.kt | 6 +- 2 files changed, 36 insertions(+), 35 deletions(-) diff --git a/app/feature/feature-insurances/src/main/kotlin/com/hedvig/android/feature/insurances/insurancedetail/yourinfo/YourInfoTab.kt b/app/feature/feature-insurances/src/main/kotlin/com/hedvig/android/feature/insurances/insurancedetail/yourinfo/YourInfoTab.kt index dc005f8a33..30365f0626 100644 --- a/app/feature/feature-insurances/src/main/kotlin/com/hedvig/android/feature/insurances/insurancedetail/yourinfo/YourInfoTab.kt +++ b/app/feature/feature-insurances/src/main/kotlin/com/hedvig/android/feature/insurances/insurancedetail/yourinfo/YourInfoTab.kt @@ -314,14 +314,14 @@ internal fun YourInfoTab( ) } - HorizontalDivider(modifier = Modifier.padding(horizontal = 16.dp)) - Spacer(Modifier.height(16.dp)) - ContractOwnerSection( - coInsuredList = coInsured, - modifier = Modifier.padding(horizontal = 16.dp), - contractHolderDisplayName = contractHolderDisplayName, - contractHolderSSN = contractHolderSSN, - ) + HorizontalDivider(modifier = Modifier.padding(horizontal = 16.dp)) + Spacer(Modifier.height(16.dp)) + ContractOwnerSection( + coInsuredList = coInsured, + modifier = Modifier.padding(horizontal = 16.dp), + contractHolderDisplayName = contractHolderDisplayName, + contractHolderSSN = contractHolderSSN, + ) if (allowEditCoInsured && coInsured.isNotEmpty()) { CoInsuredSection( @@ -834,11 +834,7 @@ internal fun ContractOwnerSection( } @Composable -internal fun CoInsuredSection( - coInsuredList: List, - isCoOwner: Boolean, - modifier: Modifier, -) { +internal fun CoInsuredSection(coInsuredList: List, isCoOwner: Boolean, modifier: Modifier) { val dateTimeFormatter = rememberHedvigDateTimeFormatter() val birthDateTimeFormatter = rememberHedvigBirthDateDateTimeFormatter() Column(modifier = modifier) { @@ -929,27 +925,30 @@ private fun PreviewYourInfoTab( DisplayItem("Type", Text("Homeowner")), DisplayItem("Size", Text("56 m2")), ), - coInsured = if (onlyInsuranceHolder) emptyList() else + coInsured = if (onlyInsuranceHolder) { + emptyList() + } else { listOf( - CoInsured( - ssn = "199101131000", - birthDate = null, - firstName = "Hu", - lastName = "Li", - activatesOn = LocalDate.fromEpochDays(300), - terminatesOn = null, - hasMissingInfo = false, - ), - CoInsured( - ssn = "1234020312", - birthDate = null, - firstName = "Testersson", - lastName = "Tester", - activatesOn = null, - terminatesOn = null, - hasMissingInfo = false, - ), - ), + CoInsured( + ssn = "199101131000", + birthDate = null, + firstName = "Hu", + lastName = "Li", + activatesOn = LocalDate.fromEpochDays(300), + terminatesOn = null, + hasMissingInfo = false, + ), + CoInsured( + ssn = "1234020312", + birthDate = null, + firstName = "Testersson", + lastName = "Tester", + activatesOn = null, + terminatesOn = null, + hasMissingInfo = false, + ), + ) + }, coOwners = listOf(), allowChangeAddress = true, allowTerminatingInsurance = true, diff --git a/app/feature/feature-terminate-insurance/src/main/kotlin/com/hedvig/android/feature/terminateinsurance/step/redirection/TerminationRedirectionDestination.kt b/app/feature/feature-terminate-insurance/src/main/kotlin/com/hedvig/android/feature/terminateinsurance/step/redirection/TerminationRedirectionDestination.kt index aedb737e40..7552190709 100644 --- a/app/feature/feature-terminate-insurance/src/main/kotlin/com/hedvig/android/feature/terminateinsurance/step/redirection/TerminationRedirectionDestination.kt +++ b/app/feature/feature-terminate-insurance/src/main/kotlin/com/hedvig/android/feature/terminateinsurance/step/redirection/TerminationRedirectionDestination.kt @@ -156,7 +156,8 @@ private fun PreviewTerminationRedirectionDestinationWithImage() { TerminationRedirectionDestination( redirection = SurveyOptionRedirection( title = "Bring Hedvig to your new home", - description = "Move your insurance to your new home with Hedvig and get 15% off your home insurance the first year.", + description = "Move your insurance to your new home with Hedvig and get 15% off your home insurance " + + "the first year.", type = RedirectionType.UPDATE_ADDRESS, actionText = "See price for new home", image = RedirectionImage(url = "", overlayText = "15% off"), @@ -179,7 +180,8 @@ private fun PreviewTerminationRedirectionDestinationWithoutImage() { TerminationRedirectionDestination( redirection = SurveyOptionRedirection( title = "Bring Hedvig to your new home", - description = "Move your insurance to your new home with Hedvig and get 15% off your home insurance the first year.", + description = "Move your insurance to your new home with Hedvig and get 15% off your home insurance " + + "the first year.", type = RedirectionType.UPDATE_ADDRESS, actionText = "See price for new home", image = null,