Upgrade ktlint and add twitter compose rules.

This commit is contained in:
Alex Hart
2023-02-06 11:04:40 -04:00
committed by Greyson Parrelli
parent 52e9b31554
commit 605289aca4
174 changed files with 574 additions and 373 deletions

View File

@@ -113,7 +113,7 @@ class ChangeNumberViewModelTest {
InstrumentationApplicationDependencyProvider.addMockWebRequestHandlers(
Get("/v1/devices") { MockResponse().success(MockProvider.primaryOnlyDeviceList) },
Put("/v1/accounts/number") { MockResponse().failure(500) },
Put("/v1/accounts/number") { MockResponse().failure(500) }
)
// WHEN

View File

@@ -69,7 +69,7 @@ class ConversationItemPreviewer {
sentTimeMillis = System.currentTimeMillis(),
serverTimeMillis = System.currentTimeMillis(),
receivedTimeMillis = System.currentTimeMillis(),
attachments = PointerAttachment.forPointers(Optional.of(attachments)),
attachments = PointerAttachment.forPointers(Optional.of(attachments))
)
SignalDatabase.messages.insertSecureDecryptedMessageInbox(message, SignalDatabase.threads.getOrCreateThreadIdFor(other)).get()
@@ -88,7 +88,7 @@ class ConversationItemPreviewer {
sentTimeMillis = System.currentTimeMillis(),
serverTimeMillis = System.currentTimeMillis(),
receivedTimeMillis = System.currentTimeMillis(),
attachments = PointerAttachment.forPointers(Optional.of(attachments)),
attachments = PointerAttachment.forPointers(Optional.of(attachments))
)
val insert = SignalDatabase.messages.insertSecureDecryptedMessageInbox(message, SignalDatabase.threads.getOrCreateThreadIdFor(other)).get()

View File

@@ -128,7 +128,7 @@ class MmsTableTest_stories {
sentTimeMillis = 2,
serverTimeMillis = 2,
receivedTimeMillis = 2,
storyType = StoryType.STORY_WITH_REPLIES,
storyType = StoryType.STORY_WITH_REPLIES
),
-1L
).get().messageId
@@ -160,7 +160,7 @@ class MmsTableTest_stories {
sentTimeMillis = System.currentTimeMillis(),
serverTimeMillis = 2,
receivedTimeMillis = 2,
storyType = StoryType.STORY_WITH_REPLIES,
storyType = StoryType.STORY_WITH_REPLIES
),
-1L
).get().messageId
@@ -174,7 +174,7 @@ class MmsTableTest_stories {
sentTimeMillis = System.currentTimeMillis(),
serverTimeMillis = 2,
receivedTimeMillis = 2,
storyType = StoryType.STORY_WITH_REPLIES,
storyType = StoryType.STORY_WITH_REPLIES
),
-1L
).get().messageId
@@ -219,7 +219,7 @@ class MmsTableTest_stories {
sentTimeMillis = 200,
serverTimeMillis = 2,
receivedTimeMillis = 2,
storyType = StoryType.STORY_WITH_REPLIES,
storyType = StoryType.STORY_WITH_REPLIES
),
-1L
)

View File

@@ -296,7 +296,7 @@ class RecipientTableTest_processPnpTupleToChangeSet {
PnpChangeSet(
id = PnpIdResolver.PnpNoopId(result.id),
operations = linkedSetOf(
PnpOperation.SetE164(result.id, E164_A),
PnpOperation.SetE164(result.id, E164_A)
)
),
result.changeSet
@@ -407,7 +407,7 @@ class RecipientTableTest_processPnpTupleToChangeSet {
val result = applyAndAssert(
listOf(
Input(E164_A, null, null),
Input(null, PNI_A, null),
Input(null, PNI_A, null)
),
Update(E164_A, PNI_A, null),
Output(E164_A, PNI_A, null)
@@ -432,7 +432,7 @@ class RecipientTableTest_processPnpTupleToChangeSet {
val result = applyAndAssert(
listOf(
Input(E164_A, null, null),
Input(null, PNI_A, null),
Input(null, PNI_A, null)
),
Update(E164_A, PNI_A, ACI_A),
Output(E164_A, PNI_A, ACI_A)
@@ -461,7 +461,7 @@ class RecipientTableTest_processPnpTupleToChangeSet {
val result = applyAndAssert(
listOf(
Input(E164_A, null, null),
Input(E164_B, PNI_A, null),
Input(E164_B, PNI_A, null)
),
Update(E164_A, PNI_A, null),
Output(E164_A, PNI_A, null)
@@ -475,7 +475,7 @@ class RecipientTableTest_processPnpTupleToChangeSet {
PnpOperation.SetPni(
recipientId = result.firstId,
pni = PNI_A
),
)
)
),
result.changeSet
@@ -487,7 +487,7 @@ class RecipientTableTest_processPnpTupleToChangeSet {
val result = applyAndAssert(
listOf(
Input(E164_A, PNI_B, null),
Input(null, PNI_A, null),
Input(null, PNI_A, null)
),
Update(E164_A, PNI_A, null),
Output(E164_A, PNI_A, null)
@@ -501,7 +501,7 @@ class RecipientTableTest_processPnpTupleToChangeSet {
PnpOperation.Merge(
primaryId = result.firstId,
secondaryId = result.secondId
),
)
)
),
result.changeSet
@@ -513,7 +513,7 @@ class RecipientTableTest_processPnpTupleToChangeSet {
val result = applyAndAssert(
listOf(
Input(E164_A, PNI_B, null),
Input(E164_B, PNI_A, null),
Input(E164_B, PNI_A, null)
),
Update(E164_A, PNI_A, null),
Output(E164_A, PNI_A, null)
@@ -536,7 +536,7 @@ class RecipientTableTest_processPnpTupleToChangeSet {
val result = applyAndAssert(
listOf(
Input(E164_A, PNI_B, null, pniSession = true),
Input(E164_B, PNI_A, null, pniSession = true),
Input(E164_B, PNI_A, null, pniSession = true)
),
Update(E164_A, PNI_A, null),
Output(E164_A, PNI_A, null)
@@ -561,7 +561,7 @@ class RecipientTableTest_processPnpTupleToChangeSet {
val result = applyAndAssert(
listOf(
Input(E164_A, PNI_A, null),
Input(null, null, ACI_A),
Input(null, null, ACI_A)
),
Update(E164_A, PNI_A, ACI_A),
Output(E164_A, PNI_A, ACI_A)
@@ -574,7 +574,7 @@ class RecipientTableTest_processPnpTupleToChangeSet {
PnpOperation.Merge(
primaryId = result.secondId,
secondaryId = result.firstId
),
)
)
),
result.changeSet
@@ -586,7 +586,7 @@ class RecipientTableTest_processPnpTupleToChangeSet {
val result = applyAndAssert(
listOf(
Input(E164_B, PNI_A, null),
Input(null, null, ACI_A),
Input(null, null, ACI_A)
),
Update(E164_A, PNI_A, ACI_A),
Output(E164_A, PNI_A, ACI_A)
@@ -599,11 +599,11 @@ class RecipientTableTest_processPnpTupleToChangeSet {
PnpOperation.RemovePni(result.firstId),
PnpOperation.SetPni(
recipientId = result.secondId,
pni = PNI_A,
pni = PNI_A
),
PnpOperation.SetE164(
recipientId = result.secondId,
e164 = E164_A,
e164 = E164_A
)
)
),
@@ -616,7 +616,7 @@ class RecipientTableTest_processPnpTupleToChangeSet {
val result = applyAndAssert(
listOf(
Input(E164_B, PNI_A, null),
Input(E164_C, null, ACI_A),
Input(E164_C, null, ACI_A)
),
Update(E164_A, PNI_A, ACI_A),
Output(E164_A, PNI_A, ACI_A)
@@ -629,11 +629,11 @@ class RecipientTableTest_processPnpTupleToChangeSet {
PnpOperation.RemovePni(result.firstId),
PnpOperation.SetPni(
recipientId = result.secondId,
pni = PNI_A,
pni = PNI_A
),
PnpOperation.SetE164(
recipientId = result.secondId,
e164 = E164_A,
e164 = E164_A
),
PnpOperation.ChangeNumberInsert(
recipientId = result.secondId,
@@ -651,7 +651,7 @@ class RecipientTableTest_processPnpTupleToChangeSet {
val result = applyAndAssert(
listOf(
Input(E164_A, PNI_A, null),
Input(E164_B, PNI_B, ACI_A),
Input(E164_B, PNI_B, ACI_A)
),
Update(E164_A, PNI_A, ACI_A),
Output(E164_A, PNI_A, ACI_A)
@@ -683,7 +683,7 @@ class RecipientTableTest_processPnpTupleToChangeSet {
val result = applyAndAssert(
listOf(
Input(E164_A, PNI_A, null),
Input(E164_B, null, ACI_A),
Input(E164_B, null, ACI_A)
),
Update(E164_A, PNI_A, ACI_A),
Output(E164_A, PNI_A, ACI_A)
@@ -726,7 +726,8 @@ class RecipientTableTest_processPnpTupleToChangeSet {
private fun insertMockSessionFor(account: ServiceId, address: ServiceId) {
SignalDatabase.rawDatabase.insert(
SessionTable.TABLE_NAME, null,
SessionTable.TABLE_NAME,
null,
contentValuesOf(
SessionTable.ACCOUNT_ID to account.toString(),
SessionTable.ADDRESS to address.toString(),

View File

@@ -65,17 +65,17 @@ class StorySendTableTest {
messageId1 = MmsHelper.insert(
recipient = distributionListRecipient1,
storyType = StoryType.STORY_WITHOUT_REPLIES,
storyType = StoryType.STORY_WITHOUT_REPLIES
)
messageId2 = MmsHelper.insert(
recipient = distributionListRecipient2,
storyType = StoryType.STORY_WITH_REPLIES,
storyType = StoryType.STORY_WITH_REPLIES
)
messageId3 = MmsHelper.insert(
recipient = distributionListRecipient3,
storyType = StoryType.STORY_WITHOUT_REPLIES,
storyType = StoryType.STORY_WITHOUT_REPLIES
)
recipients6to15 = recipients1to10.takeLast(5) + recipients11to20.take(5)

View File

@@ -69,7 +69,7 @@ class PreKeysSyncJobTest {
Put("/v2/keys/signed?identity=pni") { r ->
pniSignedPreKey = r.parsedRequestBody()
MockResponse().success()
},
}
)
// WHEN
@@ -107,7 +107,7 @@ class PreKeysSyncJobTest {
InstrumentationApplicationDependencyProvider.addMockWebRequestHandlers(
Get("/v2/keys?identity=aci") { MockResponse().success(PreKeyStatus(100)) },
Get("/v2/keys?identity=pni") { MockResponse().success(PreKeyStatus(100)) },
Get("/v2/keys?identity=pni") { MockResponse().success(PreKeyStatus(100)) }
)
// WHEN
@@ -134,7 +134,7 @@ class PreKeysSyncJobTest {
InstrumentationApplicationDependencyProvider.addMockWebRequestHandlers(
Get("/v2/keys?identity=aci") { MockResponse().success(PreKeyStatus(100)) },
Put("/v2/keys/signed?identity=pni") { MockResponse().success() },
Put("/v2/keys/signed?identity=pni") { MockResponse().success() }
)
// WHEN
@@ -173,7 +173,7 @@ class PreKeysSyncJobTest {
Put("/v2/keys/?identity=pni") { r ->
pniPreKeyStateRequest = r.parsedRequestBody()
MockResponse().success()
},
}
)
// WHEN

View File

@@ -13,7 +13,7 @@ class RxTestSchedulerRule(
val ioTestScheduler: TestScheduler = defaultTestScheduler,
val computationTestScheduler: TestScheduler = defaultTestScheduler,
val singleTestScheduler: TestScheduler = defaultTestScheduler,
val newThreadTestScheduler: TestScheduler = defaultTestScheduler,
val newThreadTestScheduler: TestScheduler = defaultTestScheduler
) : ExternalResource() {
override fun before() {

View File

@@ -21,7 +21,7 @@ class TestProtos private constructor() {
}
fun metadata(
address: AddressProto = address().build(),
address: AddressProto = address().build()
): MetadataProto.Builder {
return MetadataProto.newBuilder()
.setAddress(address)