Skip to content

Commit

Permalink
Apply changes from ktLintFormat
Browse files Browse the repository at this point in the history
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
RBusarow authored and github-actions[bot] committed Oct 23, 2023
1 parent 8c32181 commit b392ed0
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 18 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ subprojects {

// URL showing where the source code can be accessed through the web browser
remoteUrl.set(
@Suppress("ktlint:max-line-length")
@Suppress("ktlint:standard:max-line-length")
URL(
"https://github.com/square/workflow-kotlin/blob/main/$modulePath/src/${dokkaSourceSet.name}"
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@file:Suppress("ktlint:filename")
@file:Suppress("ktlint:standard:filename")

package com.squareup.sample.hellobackbutton

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@file:Suppress("ktlint:filename")
@file:Suppress("ktlint:standard:filename")

package com.squareup.sample.poetry

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,19 @@ internal class WorkflowIdentifierTest {
assertEquals(id.hashCode(), restoredId.hashCode())
}

@Suppress("ktlint:standard:max-line-length")
@Test
fun impostor_identifier_restored_from_source_is_not_equal_to_impostor_with_different_proxied_class() { // ktlint-disable max-line-length
fun impostor_identifier_restored_from_source_is_not_equal_to_impostor_with_different_proxied_class() {
val id1 = TestImpostor1(TestWorkflow1).identifier
val id2 = TestImpostor1(TestWorkflow2).identifier
val serializedId = id1.toByteStringOrNull()!!
val restoredId = WorkflowIdentifier.parse(serializedId)
assertNotEquals(id2, restoredId)
}

@Suppress("ktlint:standard:max-line-length")
@Test
fun impostor_identifier_restored_from_source_is_not_equal_to_different_impostor_with_same_proxied_class() { // ktlint-disable max-line-length
fun impostor_identifier_restored_from_source_is_not_equal_to_different_impostor_with_same_proxied_class() {
val id1 = TestImpostor1(TestWorkflow1).identifier
val id2 = TestImpostor2(TestWorkflow1).identifier
val serializedId = id1.toByteStringOrNull()!!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ internal class ChainedWorkflowInterceptor(
session: WorkflowSession
): S {
val chainedProceed = interceptors.foldRight(proceed) { workflowInterceptor, proceedAcc ->
{ props, snapshot, workflowScope ->
{
props, snapshot, workflowScope ->
workflowInterceptor.onInitialState(props, snapshot, workflowScope, proceedAcc, session)
}
}
Expand All @@ -53,7 +54,8 @@ internal class ChainedWorkflowInterceptor(
session: WorkflowSession
): S {
val chainedProceed = interceptors.foldRight(proceed) { workflowInterceptor, proceedAcc ->
{ old, new, state ->
{
old, new, state ->
workflowInterceptor.onPropsChanged(old, new, state, proceedAcc, session)
}
}
Expand All @@ -66,7 +68,8 @@ internal class ChainedWorkflowInterceptor(
session: WorkflowSession
): RenderingAndSnapshot<R> {
val chainedProceed = interceptors.foldRight(proceed) { workflowInterceptor, proceedAcc ->
{ renderProps ->
{
renderProps ->
workflowInterceptor.onRenderAndSnapshot(renderProps, proceedAcc, session)
}
}
Expand All @@ -81,7 +84,8 @@ internal class ChainedWorkflowInterceptor(
session: WorkflowSession
): R {
val chainedProceed = interceptors.foldRight(proceed) { workflowInterceptor, proceedAcc ->
{ props, state, outerContextInterceptor ->
{
props, state, outerContextInterceptor ->
workflowInterceptor.onRender(
props,
state,
Expand Down Expand Up @@ -115,7 +119,8 @@ internal class ChainedWorkflowInterceptor(
session: WorkflowSession
): Snapshot? {
val chainedProceed = interceptors.foldRight(proceed) { workflowInterceptor, proceedAcc ->
{ state ->
{
state ->
workflowInterceptor.onSnapshotState(state, proceedAcc, session)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,9 @@ internal class RealRenderTesterTest {
assertEquals("Expected side effect keys to be unique: \"key\"", error.message)
}

@Suppress("ktlint:standard:max-line-length")
@Test
fun `renderChild rendering non-Unit throws when none expected and unexpected children are allowed`() { // ktlint-disable max-line-length
fun `renderChild rendering non-Unit throws when none expected and unexpected children are allowed`() {
val child = Workflow.stateless<Unit, Nothing, Int> { 42 }
val workflow = Workflow.stateless<Unit, Nothing, Unit> {
renderChild(child)
Expand Down Expand Up @@ -560,8 +561,9 @@ internal class RealRenderTesterTest {
tester.render()
}

@Suppress("ktlint:standard:max-line-length")
@Test
fun `runningSideEffect does throw when none expected and require explicit side effect is set`() { // ktlint-disable max-line-length
fun `runningSideEffect does throw when none expected and require explicit side effect is set`() {
val key = "foo"
val workflow = Workflow.stateless<Unit, Nothing, Unit> {
runningSideEffect(key = key) { }
Expand Down Expand Up @@ -871,8 +873,9 @@ internal class RealRenderTesterTest {
.render {}
}

@Suppress("ktlint:standard:max-line-length")
@Test
fun `expectWorkflow doesn't match same ImpostorWorkflow class with different proxy identifiers`() { // ktlint-disable max-line-length
fun `expectWorkflow doesn't match same ImpostorWorkflow class with different proxy identifiers`() {
class TestWorkflowActual : Workflow<Unit, Nothing, Unit> {
override fun asStatefulWorkflow(): StatefulWorkflow<Unit, *, Nothing, Unit> =
throw NotImplementedError()
Expand Down Expand Up @@ -1474,8 +1477,9 @@ internal class RealRenderTesterTest {
assertFalse(actual.realTypeMatchesExpectation(expected))
}

@Suppress("ktlint:standard:max-line-length")
@Test
fun `realTypeMatchesExpectation() doesn't match exact contravariant type with supertype parameter`() { // ktlint-disable max-line-length
fun `realTypeMatchesExpectation() doesn't match exact contravariant type with supertype parameter`() {
val expected = unsnapshottableIdentifier(typeOf<ContravariantGenericType<CharSequence>>())
val actual = unsnapshottableIdentifier(typeOf<ContravariantGenericType<String>>())
assertFalse(actual.realTypeMatchesExpectation(expected))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ class RenderIdempotencyCheckerTest {

@Test fun `events sent to sink read after render are accepted`() {
val workflow = Workflow.stateless<Unit, String, (String) -> Unit> {
{ value: String ->
{
value: String ->
actionSink.send(
action {
setOutput(value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ internal class RenderAsStateTest {

@Test fun invokesOutputCallback() {
val workflow = Workflow.stateless<Unit, String, (String) -> Unit> {
{ string -> actionSink.send(action { setOutput(string) }) }
{
string ->
actionSink.send(action { setOutput(string) })
}
}
val receivedOutputs = mutableListOf<String>()
lateinit var rendering: (String) -> Unit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ internal class BackStackScreenTest {
data class BarScreen<T>(val value: T) : Screen

@Test fun `top is last`() {
assertThat(BackStackScreen(FooScreen(1), FooScreen(2), FooScreen(3), FooScreen(4)).top).isEqualTo(
assertThat(
BackStackScreen(FooScreen(1), FooScreen(2), FooScreen(3), FooScreen(4)).top
).isEqualTo(
FooScreen(4)
)
}
Expand All @@ -23,7 +25,9 @@ internal class BackStackScreenTest {
}

@Test fun `get works`() {
assertThat(BackStackScreen(FooScreen("able"), FooScreen("baker"), FooScreen("charlie"))[1]).isEqualTo(
assertThat(
BackStackScreen(FooScreen("able"), FooScreen("baker"), FooScreen("charlie"))[1]
).isEqualTo(
FooScreen("baker")
)
}
Expand Down

0 comments on commit b392ed0

Please sign in to comment.