mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-26 20:55:10 +00:00
Upgrade ktlint and add twitter compose rules.
This commit is contained in:
committed by
Greyson Parrelli
parent
52e9b31554
commit
605289aca4
@@ -21,7 +21,7 @@ class FullBackupExporterTest {
|
||||
mapOf(
|
||||
"A" to setOf(),
|
||||
"B" to setOf(),
|
||||
"C" to setOf(),
|
||||
"C" to setOf()
|
||||
)
|
||||
)
|
||||
|
||||
@@ -40,7 +40,7 @@ class FullBackupExporterTest {
|
||||
val order = FullBackupExporter.computeTableOrder(
|
||||
mapOf(
|
||||
"C" to setOf("B"),
|
||||
"B" to setOf("A"),
|
||||
"B" to setOf("A")
|
||||
)
|
||||
)
|
||||
|
||||
@@ -63,7 +63,7 @@ class FullBackupExporterTest {
|
||||
"H" to setOf(),
|
||||
"A" to setOf(),
|
||||
"C" to setOf(),
|
||||
"D" to setOf(),
|
||||
"D" to setOf()
|
||||
)
|
||||
)
|
||||
|
||||
@@ -89,7 +89,7 @@ class FullBackupExporterTest {
|
||||
"B" to setOf(),
|
||||
"D" to setOf(),
|
||||
"F" to setOf(),
|
||||
"G" to setOf(),
|
||||
"G" to setOf()
|
||||
)
|
||||
)
|
||||
|
||||
@@ -112,7 +112,7 @@ class FullBackupExporterTest {
|
||||
"B" to setOf(),
|
||||
"D" to setOf(),
|
||||
"F" to setOf(),
|
||||
"G" to setOf(),
|
||||
"G" to setOf()
|
||||
)
|
||||
)
|
||||
|
||||
@@ -132,7 +132,7 @@ class FullBackupExporterTest {
|
||||
"D" to setOf("A"),
|
||||
"E" to setOf("A", "B"),
|
||||
"A" to setOf(),
|
||||
"B" to setOf(),
|
||||
"B" to setOf()
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class FullBackupImporterTest {
|
||||
mapOf(
|
||||
"A" to setOf(),
|
||||
"B" to setOf(),
|
||||
"C" to setOf(),
|
||||
"C" to setOf()
|
||||
)
|
||||
)
|
||||
|
||||
@@ -40,7 +40,7 @@ class FullBackupImporterTest {
|
||||
val order = FullBackupImporter.computeTableDropOrder(
|
||||
mapOf(
|
||||
"A" to setOf("B"),
|
||||
"B" to setOf("C"),
|
||||
"B" to setOf("C")
|
||||
)
|
||||
)
|
||||
|
||||
@@ -63,7 +63,7 @@ class FullBackupImporterTest {
|
||||
"E" to setOf("G", "H"),
|
||||
"F" to setOf(),
|
||||
"G" to setOf(),
|
||||
"H" to setOf(),
|
||||
"H" to setOf()
|
||||
)
|
||||
)
|
||||
|
||||
@@ -89,7 +89,7 @@ class FullBackupImporterTest {
|
||||
"F" to setOf(),
|
||||
"G" to setOf(),
|
||||
"H" to setOf(),
|
||||
"I" to setOf(),
|
||||
"I" to setOf()
|
||||
)
|
||||
)
|
||||
|
||||
@@ -112,7 +112,7 @@ class FullBackupImporterTest {
|
||||
"E" to setOf(),
|
||||
"F" to setOf(),
|
||||
"G" to setOf(),
|
||||
"H" to setOf(),
|
||||
"H" to setOf()
|
||||
)
|
||||
)
|
||||
|
||||
@@ -132,7 +132,7 @@ class FullBackupImporterTest {
|
||||
"B" to setOf("D"),
|
||||
"C" to setOf("D", "E"),
|
||||
"D" to setOf(),
|
||||
"E" to setOf(),
|
||||
"E" to setOf()
|
||||
)
|
||||
)
|
||||
|
||||
@@ -153,7 +153,7 @@ class FullBackupImporterTest {
|
||||
"A" to setOf("D"),
|
||||
"B" to setOf("C"),
|
||||
"C" to setOf("D"),
|
||||
"D" to setOf(),
|
||||
"D" to setOf()
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ class CreditCardTextWatcherTest(
|
||||
arrayOf("55000000000", "5500 0000 000"),
|
||||
arrayOf("550000000000000", "5500 0000 0000 000"),
|
||||
arrayOf("5500000000000000", "5500 0000 0000 0000"),
|
||||
arrayOf("55000000000000000", "55000 00000 00000 00"),
|
||||
arrayOf("55000000000000000", "55000 00000 00000 00")
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ class CreditCardTypeTest(
|
||||
arrayOf("2223003122003222", CreditCardType.OTHER),
|
||||
arrayOf("6011111111111117", CreditCardType.OTHER),
|
||||
arrayOf("3056930009020004", CreditCardType.OTHER),
|
||||
arrayOf("3566002020360505", CreditCardType.OTHER),
|
||||
arrayOf("3566002020360505", CreditCardType.OTHER)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ class ContactSearchPagedDataSourceTest {
|
||||
ContactSearchKey.RecipientSearchKey(RecipientId.UNKNOWN, true),
|
||||
ContactSearchKey.RecipientSearchKey(RecipientId.UNKNOWN, true),
|
||||
ContactSearchKey.RecipientSearchKey(RecipientId.UNKNOWN, true),
|
||||
ContactSearchKey.RecipientSearchKey(RecipientId.UNKNOWN, true),
|
||||
ContactSearchKey.RecipientSearchKey(RecipientId.UNKNOWN, true)
|
||||
)
|
||||
|
||||
val resultKeys = result.map { it.contactSearchKey }
|
||||
|
||||
@@ -40,7 +40,7 @@ class ConversationItemTest_linkifyUrlLinks(private val input: String, private va
|
||||
arrayOf("https://www.instagram.com/tv/CfImYdngccQ/?igshid=YmMyMTA2M2Y=\n", "https://www.instagram.com/tv/CfImYdngccQ/?igshid=YmMyMTA2M2Y="),
|
||||
// arrayOf("https://fr.ulule.com/sapins-barbus-la-bd-/ ", "https://fr.ulule.com/sapins-barbus-la-bd-/"),
|
||||
arrayOf("https://fr.ulule.com/sapins-barbus-la-bd-/\n", "https://fr.ulule.com/sapins-barbus-la-bd-/"),
|
||||
arrayOf("https://de.m.wikipedia.org/wiki/Red_Dawn_(2012)", "https://de.m.wikipedia.org/wiki/Red_Dawn_(2012)"),
|
||||
arrayOf("https://de.m.wikipedia.org/wiki/Red_Dawn_(2012)", "https://de.m.wikipedia.org/wiki/Red_Dawn_(2012)")
|
||||
// arrayOf("https://de.m.wikipedia.org/wiki/Red_Dawn_(2012)\n\n\uD83E\uDD14\uD83D\uDE1C", "https://de.m.wikipedia.org/wiki/Red_Dawn_(2012)")
|
||||
)
|
||||
}
|
||||
|
||||
@@ -52,7 +52,8 @@ class ContactSearchSelectionBuilderTest {
|
||||
Assert.assertTrue(result.where.contains(RecipientTable.ContactSearchSelection.FILTER_HIDDEN))
|
||||
Assert.assertArrayEquals(
|
||||
SqlUtil.buildArgs(
|
||||
RecipientTable.RegisteredState.REGISTERED.id, 1,
|
||||
RecipientTable.RegisteredState.REGISTERED.id,
|
||||
1,
|
||||
RecipientTable.RegisteredState.REGISTERED.id,
|
||||
0,
|
||||
0
|
||||
|
||||
@@ -209,7 +209,6 @@ fun decryptedGroup(
|
||||
inviteLinkPassword: ByteArray = ByteArray(0),
|
||||
disappearingMessageTimer: DecryptedTimer = DecryptedTimer.getDefaultInstance()
|
||||
): DecryptedGroup {
|
||||
|
||||
val builder = DecryptedGroup.newBuilder()
|
||||
.setAccessControl(accessControl)
|
||||
.setAvatar(avatar)
|
||||
|
||||
@@ -136,7 +136,7 @@ object RecipientDatabaseTestUtils {
|
||||
Recipient.Capability.deserialize(Bitmask.read(capabilities, RecipientTable.Capabilities.STORIES, RecipientTable.Capabilities.BIT_LENGTH).toInt()),
|
||||
Recipient.Capability.deserialize(Bitmask.read(capabilities, RecipientTable.Capabilities.GIFT_BADGES, RecipientTable.Capabilities.BIT_LENGTH).toInt()),
|
||||
Recipient.Capability.deserialize(Bitmask.read(capabilities, RecipientTable.Capabilities.PNP, RecipientTable.Capabilities.BIT_LENGTH).toInt()),
|
||||
Recipient.Capability.deserialize(Bitmask.read(capabilities, RecipientTable.Capabilities.PAYMENT_ACTIVATION, RecipientTable.Capabilities.BIT_LENGTH).toInt()),
|
||||
Recipient.Capability.deserialize(Bitmask.read(capabilities, RecipientTable.Capabilities.PAYMENT_ACTIVATION, RecipientTable.Capabilities.BIT_LENGTH).toInt())
|
||||
),
|
||||
insightBannerTier,
|
||||
storageId,
|
||||
|
||||
@@ -73,7 +73,7 @@ object TestMms {
|
||||
unread: Boolean = false,
|
||||
viewed: Boolean = false,
|
||||
threadId: Long = 1,
|
||||
receivedTimestampMillis: Long = System.currentTimeMillis(),
|
||||
receivedTimestampMillis: Long = System.currentTimeMillis()
|
||||
): Long {
|
||||
val contentValues = ContentValues().apply {
|
||||
put(MessageTable.DATE_SENT, message.sentTimeMillis)
|
||||
|
||||
@@ -74,7 +74,7 @@ class TextToScriptTest(
|
||||
arrayOf(
|
||||
listOf("ППППaaaa", ""),
|
||||
SupportedScript.LATIN
|
||||
),
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,8 @@ import org.thoughtcrime.securesms.util.FeatureFlags
|
||||
class PaymentsValuesTest {
|
||||
|
||||
@Rule
|
||||
@JvmField val mockitoRule: MockitoRule = MockitoJUnit.rule()
|
||||
@JvmField
|
||||
val mockitoRule: MockitoRule = MockitoJUnit.rule()
|
||||
|
||||
@Mock
|
||||
private lateinit var featureFlags: MockedStatic<FeatureFlags>
|
||||
|
||||
@@ -28,7 +28,8 @@ import java.util.Optional
|
||||
class MediaRepositoryTest {
|
||||
|
||||
@Rule
|
||||
@JvmField val mockitoRule: MockitoRule = MockitoJUnit.rule()
|
||||
@JvmField
|
||||
val mockitoRule: MockitoRule = MockitoJUnit.rule()
|
||||
|
||||
@Mock
|
||||
private lateinit var staticMediaUtilMock: MockedStatic<MediaUtil>
|
||||
@@ -129,7 +130,7 @@ class MediaRepositoryTest {
|
||||
videoGif,
|
||||
bucketId,
|
||||
caption,
|
||||
transformProperties,
|
||||
transformProperties
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ class RemoteMegaphoneRepositoryTest {
|
||||
primaryActionData,
|
||||
secondaryActionData,
|
||||
snoozedAt,
|
||||
seenCount,
|
||||
seenCount
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,8 @@ import org.thoughtcrime.securesms.keyvalue.SignalStore
|
||||
abstract class BaseRecipientTest {
|
||||
|
||||
@Rule
|
||||
@JvmField val mockitoRule: MockitoRule = MockitoJUnit.rule()
|
||||
@JvmField
|
||||
val mockitoRule: MockitoRule = MockitoJUnit.rule()
|
||||
|
||||
@Mock
|
||||
private lateinit var applicationDependenciesStaticMock: MockedStatic<ApplicationDependencies>
|
||||
|
||||
@@ -104,7 +104,7 @@ class StoryViewerViewModelTest {
|
||||
val testSubject = StoryViewerViewModel(
|
||||
StoryViewerArgs(
|
||||
recipientId = startStory,
|
||||
isInHiddenStoryMode = false,
|
||||
isInHiddenStoryMode = false
|
||||
),
|
||||
repository
|
||||
)
|
||||
@@ -131,7 +131,7 @@ class StoryViewerViewModelTest {
|
||||
val testSubject = StoryViewerViewModel(
|
||||
StoryViewerArgs(
|
||||
recipientId = startStory,
|
||||
isInHiddenStoryMode = false,
|
||||
isInHiddenStoryMode = false
|
||||
),
|
||||
repository
|
||||
)
|
||||
@@ -158,7 +158,7 @@ class StoryViewerViewModelTest {
|
||||
val testSubject = StoryViewerViewModel(
|
||||
StoryViewerArgs(
|
||||
recipientId = startStory,
|
||||
isInHiddenStoryMode = false,
|
||||
isInHiddenStoryMode = false
|
||||
),
|
||||
repository
|
||||
)
|
||||
@@ -185,7 +185,7 @@ class StoryViewerViewModelTest {
|
||||
val testSubject = StoryViewerViewModel(
|
||||
StoryViewerArgs(
|
||||
recipientId = startStory,
|
||||
isInHiddenStoryMode = false,
|
||||
isInHiddenStoryMode = false
|
||||
),
|
||||
repository
|
||||
)
|
||||
@@ -212,7 +212,7 @@ class StoryViewerViewModelTest {
|
||||
val testSubject = StoryViewerViewModel(
|
||||
StoryViewerArgs(
|
||||
recipientId = startStory,
|
||||
isInHiddenStoryMode = false,
|
||||
isInHiddenStoryMode = false
|
||||
),
|
||||
repository
|
||||
)
|
||||
|
||||
@@ -14,7 +14,7 @@ import net.zetetic.database.sqlcipher.SQLiteDatabase as SQLCipherSQLiteDatabase
|
||||
class ProxySQLCipherOpenHelper(
|
||||
context: Application,
|
||||
val readableDatabase: AndroidSQLiteDatabase,
|
||||
val writableDatabase: AndroidSQLiteDatabase,
|
||||
val writableDatabase: AndroidSQLiteDatabase
|
||||
) : SignalDatabase(context, DatabaseSecret(ByteArray(32).apply { SecureRandom().nextBytes(this) }), AttachmentSecret()) {
|
||||
|
||||
constructor(context: Application, testOpenHelper: TestSQLiteOpenHelper) : this(context, testOpenHelper.readableDatabase, testOpenHelper.writableDatabase)
|
||||
|
||||
@@ -33,7 +33,7 @@ class NameUtil_getAbbreviation(
|
||||
arrayOf("љabc ђ123", "љђ"),
|
||||
// Works on device, but for whatever reason doesn't work in robolectric
|
||||
// arrayOf("Bob \uD83C\uDDE8\uD83C\uDDFF", "B\uD83C\uDDE8\uD83C\uDDFF"),
|
||||
arrayOf("", null),
|
||||
arrayOf("", null)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user