You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there. I just updated org.jlleitschuh.gradle.ktlint from 10.0.0 to 10.2.1 and in one of my classes I get now surprising complaints about the indentation.
Here's the class code:
classMailbox(privatevaltopic:String) {
companionobject {
funfromMailAddress(mail:String) =Mailbox(getTopicFrom(mail))
}
funexpectSubscriptionMailIn(waitingTimeInSeconds:Int): Email=
waitUntil({ it.isSubConfirmation() }, "Subscription mail for $topic", waitingTimeInSeconds).first()
funexpectSessionReportIn(waitingTimeInSeconds:Int): String=
waitUntil({ it.isSessionReport() }, "Session Report for $topic", waitingTimeInSeconds).first()
.returnReportLink()
funexpectErrorMailIn(waitingTimeInSeconds:Int, errorCode:String): Email=
waitUntil({ it.isErrorMessage(errorCode) }, "Error mail for $topic", waitingTimeInSeconds).first()
funexpectOfflineMailIn(waitingTimeInSeconds:Int): Email=
waitUntil({ it.isOfflineError() }, "Offline mail for $topic", waitingTimeInSeconds).first()
funexpectFleetInvitationIn(waitingTimeInSeconds:Int): String=
waitUntil({ it.isFleetInvite() }, "Fleet invite for $topic", waitingTimeInSeconds).first()
.findLink()
funexpectMailsBySubject(varargsubjectCandidates:String) =
waitUntil({ subjectCandidates.contains(it.subject) }, "Mail for $topic", 60)
funsubscribeToAwsNotifications(): Mailbox=apply {
val subscriptionEmail = expectSubscriptionMailIn(90)
subscriptionEmail.subscribe()
}
privatefunwaitUntil(predicate:Predicate<Email>, alias:String, waitingTimeInSeconds:Int): List<Email> =
checkMailsFor(predicate, alias, waitingTimeInSeconds, topic)
}
now the check failed as follows:
> Task :ktlintTestSourceSetCheck FAILED
.../Mailbox.kt:19:1 Unexpected indentation (4) (should be 8)
.../Mailbox.kt:20:1 Unexpected indentation (8) (should be 12)
.../Mailbox.kt:21:1 Unexpected indentation (12) (should be 20)
.../Mailbox.kt:23:1 Unexpected indentation (4) (should be 12)
.../Mailbox.kt:24:1 Unexpected indentation (8) (should be 16)
.../Mailbox.kt:26:1 Unexpected indentation (4) (should be 16)
.../Mailbox.kt:27:1 Unexpected indentation (8) (should be 20)
.../Mailbox.kt:29:1 Unexpected indentation (4) (should be 20)
.../Mailbox.kt:30:1 Unexpected indentation (8) (should be 24)
.../Mailbox.kt:31:1 Unexpected indentation (12) (should be 32)
.../Mailbox.kt:33:1 Unexpected indentation (4) (should be 24)
.../Mailbox.kt:34:1 Unexpected indentation (8) (should be 28)
.../Mailbox.kt:36:1 Unexpected indentation (4) (should be 24)
if I run the formatter, I end up with this:
classMailbox(privatevaltopic:String) {
companionobject {
funfromMailAddress(mail:String) =Mailbox(getTopicFrom(mail))
}
funexpectSubscriptionMailIn(waitingTimeInSeconds:Int): Email=
waitUntil({ it.isSubConfirmation() }, "Subscription mail for $topic", waitingTimeInSeconds).first()
funexpectSessionReportIn(waitingTimeInSeconds:Int): String=
waitUntil({ it.isSessionReport() }, "Session Report for $topic", waitingTimeInSeconds).first()
.returnReportLink()
funexpectErrorMailIn(waitingTimeInSeconds:Int, errorCode:String): Email=
waitUntil({ it.isErrorMessage(errorCode) }, "Error mail for $topic", waitingTimeInSeconds).first()
funexpectOfflineMailIn(waitingTimeInSeconds:Int): Email=
waitUntil({ it.isOfflineError() }, "Offline mail for $topic", waitingTimeInSeconds).first()
funexpectFleetInvitationIn(waitingTimeInSeconds:Int): String=
waitUntil({ it.isFleetInvite() }, "Fleet invite for $topic", waitingTimeInSeconds).first()
.findLink()
funexpectMailsBySubject(varargsubjectCandidates:String) =
waitUntil({ subjectCandidates.contains(it.subject) }, "Mail for $topic", 60)
funsubscribeToAwsNotifications(): Mailbox=apply {
val subscriptionEmail = expectSubscriptionMailIn(90)
subscriptionEmail.subscribe()
}
privatefunwaitUntil(predicate:Predicate<Email>, alias:String, waitingTimeInSeconds:Int): List<Email> =
checkMailsFor(predicate, alias, waitingTimeInSeconds, topic)
}
I don't really understand why. It feels like the equal signs work almost as opening parentheses but not closing ones.
Even more curious is that this is the only file in the project that has this issue (but I am almost certain it is also the only one that contains only single expression functions that are longer than a single line (with exception of the companion object)
And I am pretty convinced that this format is not how it should be. Ktlint usually gives me beautiful code (yay!), but this doesn't look right 😅
EDIT: I tried the versions backwards and it works with 10.1.0 but not with 10.2.0
The text was updated successfully, but these errors were encountered:
Hi there. I just updated org.jlleitschuh.gradle.ktlint from
10.0.0
to10.2.1
and in one of my classes I get now surprising complaints about the indentation.Here's the class code:
now the check failed as follows:
if I run the formatter, I end up with this:
I don't really understand why. It feels like the equal signs work almost as opening parentheses but not closing ones.
Even more curious is that this is the only file in the project that has this issue (but I am almost certain it is also the only one that contains only single expression functions that are longer than a single line (with exception of the companion object)
And I am pretty convinced that this format is not how it should be. Ktlint usually gives me beautiful code (yay!), but this doesn't look right 😅
EDIT: I tried the versions backwards and it works with
10.1.0
but not with10.2.0
The text was updated successfully, but these errors were encountered: