Skip to content

Commit 1ee762f

Browse files
committed
Merge branch 'deterministically-use-trailing-commas-in-kotlin-code-droid-89'
2 parents 3286d40 + 981e97d commit 1ee762f

File tree

362 files changed

+2004
-2296
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

362 files changed

+2004
-2296
lines changed

android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/Actions.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import androidx.compose.ui.test.longClick
77
import androidx.compose.ui.test.performTouchInput
88

99
fun SemanticsNodeInteraction.performLongClick(): SemanticsNodeInteraction {
10-
@OptIn(ExperimentalTestApi::class) return this.invokeGlobalAssertions().performLongClickImpl()
10+
@OptIn(ExperimentalTestApi::class)
11+
return this.invokeGlobalAssertions().performLongClickImpl()
1112
}
1213

1314
private fun SemanticsNodeInteraction.performLongClickImpl(): SemanticsNodeInteraction {

android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/Finders.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ fun SemanticsNodeInteractionsProvider.onNodeWithTagAndText(
1010
text: String,
1111
substring: Boolean = false,
1212
ignoreCase: Boolean = false,
13-
useUnmergedTree: Boolean = false
13+
useUnmergedTree: Boolean = false,
1414
): SemanticsNodeInteraction =
1515
onNode(hasTestTag(testTag).and(hasText(text, substring, ignoreCase)), useUnmergedTree)

android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/data/DummyApiAccessMethods.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ val DIRECT_ACCESS_METHOD =
1515
id = ApiAccessMethodId.fromString(UUID1),
1616
name = ApiAccessMethodName.fromString("Direct"),
1717
enabled = true,
18-
apiAccessMethod = ApiAccessMethod.Direct
18+
apiAccessMethod = ApiAccessMethod.Direct,
1919
)
2020

2121
val CUSTOM_ACCESS_METHOD =
@@ -28,6 +28,6 @@ val CUSTOM_ACCESS_METHOD =
2828
ip = "1.1.1.1",
2929
port = Port(123),
3030
password = "Password",
31-
cipher = Cipher.RC4
32-
)
31+
cipher = Cipher.RC4,
32+
),
3333
)

android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/data/DummyRelayItems.kt

+15-22
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,22 @@ private val DUMMY_RELAY_1 =
1717
id =
1818
GeoLocationId.Hostname(
1919
city = GeoLocationId.City(GeoLocationId.Country("RCo1"), "Relay City 1"),
20-
"Relay host 1"
20+
"Relay host 1",
2121
),
2222
active = true,
2323
provider =
24-
Provider(
25-
providerId = ProviderId("PROVIDER RENTED"),
26-
ownership = Ownership.Rented,
27-
)
24+
Provider(providerId = ProviderId("PROVIDER RENTED"), ownership = Ownership.Rented),
2825
)
2926
private val DUMMY_RELAY_2 =
3027
RelayItem.Location.Relay(
3128
id =
3229
GeoLocationId.Hostname(
3330
city = GeoLocationId.City(GeoLocationId.Country("RCo2"), "Relay City 2"),
34-
"Relay host 2"
31+
"Relay host 2",
3532
),
3633
active = true,
3734
provider =
38-
Provider(providerId = ProviderId("PROVIDER OWNED"), ownership = Ownership.MullvadOwned)
35+
Provider(providerId = ProviderId("PROVIDER OWNED"), ownership = Ownership.MullvadOwned),
3936
)
4037
private val DUMMY_RELAY_CITY_1 =
4138
RelayItem.Location.City(
@@ -53,25 +50,21 @@ private val DUMMY_RELAY_COUNTRY_1 =
5350
RelayItem.Location.Country(
5451
name = "Relay Country 1",
5552
id = GeoLocationId.Country("RCo1"),
56-
cities = listOf(DUMMY_RELAY_CITY_1)
53+
cities = listOf(DUMMY_RELAY_CITY_1),
5754
)
5855
private val DUMMY_RELAY_COUNTRY_2 =
5956
RelayItem.Location.Country(
6057
name = "Relay Country 2",
6158
id = GeoLocationId.Country("RCo2"),
62-
cities = listOf(DUMMY_RELAY_CITY_2)
59+
cities = listOf(DUMMY_RELAY_CITY_2),
6360
)
6461

6562
private val DUMMY_WIREGUARD_PORT_RANGES = ArrayList<PortRange>()
6663
private val DUMMY_WIREGUARD_ENDPOINT_DATA = WireguardEndpointData(DUMMY_WIREGUARD_PORT_RANGES)
6764

6865
val DUMMY_RELAY_COUNTRIES = listOf(DUMMY_RELAY_COUNTRY_1, DUMMY_RELAY_COUNTRY_2)
6966

70-
val DUMMY_RELAY_LIST =
71-
RelayList(
72-
DUMMY_RELAY_COUNTRIES,
73-
DUMMY_WIREGUARD_ENDPOINT_DATA,
74-
)
67+
val DUMMY_RELAY_LIST = RelayList(DUMMY_RELAY_COUNTRIES, DUMMY_WIREGUARD_ENDPOINT_DATA)
7568

7669
val DUMMY_RELAY_ITEM_CUSTOM_LISTS =
7770
listOf(
@@ -80,31 +73,31 @@ val DUMMY_RELAY_ITEM_CUSTOM_LISTS =
8073
CustomList(
8174
name = CustomListName.fromString("First list"),
8275
id = CustomListId("1"),
83-
locations = emptyList()
76+
locations = emptyList(),
8477
),
85-
locations = DUMMY_RELAY_COUNTRIES
78+
locations = DUMMY_RELAY_COUNTRIES,
8679
),
8780
RelayItem.CustomList(
8881
customList =
8982
CustomList(
9083
name = CustomListName.fromString("Empty list"),
9184
id = CustomListId("2"),
92-
locations = emptyList()
85+
locations = emptyList(),
9386
),
94-
locations = emptyList()
95-
)
87+
locations = emptyList(),
88+
),
9689
)
9790

9891
val DUMMY_CUSTOM_LISTS =
9992
listOf(
10093
CustomList(
10194
name = CustomListName.fromString("First list"),
10295
id = CustomListId("1"),
103-
locations = DUMMY_RELAY_COUNTRIES.map { it.id }
96+
locations = DUMMY_RELAY_COUNTRIES.map { it.id },
10497
),
10598
CustomList(
10699
name = CustomListName.fromString("Empty list"),
107100
id = CustomListId("2"),
108-
locations = emptyList()
109-
)
101+
locations = emptyList(),
102+
),
110103
)

android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/dialog/CustomPortDialogTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class CustomPortDialogTest {
4040
initialPort = initialPort,
4141
allowedPortRanges = allowedPortRanges,
4242
onSave = onSave,
43-
onDismiss = onDismiss
43+
onDismiss = onDismiss,
4444
)
4545
}
4646

android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeleteCustomListConfirmationDialogTest.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class DeleteCustomListConfirmationDialogTest {
3232
val name = CustomListName.fromString("List should be deleted")
3333
setContentWithTheme {
3434
DeleteCustomListConfirmationDialog(
35-
state = DeleteCustomListUiState(name = name, deleteError = null),
35+
state = DeleteCustomListUiState(name = name, deleteError = null)
3636
)
3737
}
3838

@@ -49,7 +49,7 @@ class DeleteCustomListConfirmationDialogTest {
4949
setContentWithTheme {
5050
DeleteCustomListConfirmationDialog(
5151
state = DeleteCustomListUiState(name = name, deleteError = null),
52-
onDelete = mockedOnDelete
52+
onDelete = mockedOnDelete,
5353
)
5454
}
5555

@@ -69,7 +69,7 @@ class DeleteCustomListConfirmationDialogTest {
6969
setContentWithTheme {
7070
DeleteCustomListConfirmationDialog(
7171
state = DeleteCustomListUiState(name = name, deleteError = null),
72-
onBack = mockedOnBack
72+
onBack = mockedOnBack,
7373
)
7474
}
7575

android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/dialog/DnsDialogTest.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class DnsDialogTest {
2424
validationError = null,
2525
isLocal = false,
2626
isAllowLanEnabled = false,
27-
index = null
27+
index = null,
2828
)
2929

3030
@SuppressLint("ComposableNaming")
@@ -34,7 +34,7 @@ class DnsDialogTest {
3434
onDnsInputChange: (String) -> Unit = { _ -> },
3535
onSaveDnsClick: () -> Unit = {},
3636
onRemoveDnsClick: (Int) -> Unit = {},
37-
onDismiss: () -> Unit = {}
37+
onDismiss: () -> Unit = {},
3838
) {
3939
DnsDialog(state, onDnsInputChange, onSaveDnsClick, onRemoveDnsClick, onDismiss)
4040
}

android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/dialog/MtuDialogTest.kt

+5-19
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class MtuDialogTest {
4444
onInputChanged = onInputChanged,
4545
onSaveMtu = onSaveMtu,
4646
onResetMtu = onResetMtu,
47-
onDismiss = onDismiss
47+
onDismiss = onDismiss,
4848
)
4949
}
5050

@@ -62,11 +62,7 @@ class MtuDialogTest {
6262
fun testMtuDialogWithEditValue() =
6363
composeExtension.use {
6464
// Arrange
65-
setContentWithTheme {
66-
testMtuDialog(
67-
mtuInput = VALID_DUMMY_MTU_VALUE,
68-
)
69-
}
65+
setContentWithTheme { testMtuDialog(mtuInput = VALID_DUMMY_MTU_VALUE) }
7066

7167
// Assert
7268
onNodeWithText(VALID_DUMMY_MTU_VALUE).assertExists()
@@ -78,10 +74,7 @@ class MtuDialogTest {
7874
// Arrange
7975
val mockedSubmitHandler: (String) -> Unit = mockk(relaxed = true)
8076
setContentWithTheme {
81-
testMtuDialog(
82-
VALID_DUMMY_MTU_VALUE,
83-
onSaveMtu = mockedSubmitHandler,
84-
)
77+
testMtuDialog(VALID_DUMMY_MTU_VALUE, onSaveMtu = mockedSubmitHandler)
8578
}
8679

8780
// Act
@@ -107,10 +100,7 @@ class MtuDialogTest {
107100
// Arrange
108101
val mockedClickHandler: () -> Unit = mockk(relaxed = true)
109102
setContentWithTheme {
110-
testMtuDialog(
111-
mtuInput = VALID_DUMMY_MTU_VALUE,
112-
onResetMtu = mockedClickHandler,
113-
)
103+
testMtuDialog(mtuInput = VALID_DUMMY_MTU_VALUE, onResetMtu = mockedClickHandler)
114104
}
115105

116106
// Act
@@ -125,11 +115,7 @@ class MtuDialogTest {
125115
composeExtension.use {
126116
// Arrange
127117
val mockedClickHandler: () -> Unit = mockk(relaxed = true)
128-
setContentWithTheme {
129-
testMtuDialog(
130-
onDismiss = mockedClickHandler,
131-
)
132-
}
118+
setContentWithTheme { testMtuDialog(onDismiss = mockedClickHandler) }
133119

134120
// Assert
135121
onNodeWithText("Cancel").performClick()

android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/dialog/ResetServerIPOverridesConfirmationDialogTest.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class ResetServerIPOverridesConfirmationDialogTest {
3434
setContentWithTheme {
3535
ResetServerIpOverridesConfirmationDialog(
3636
onNavigateBack = clickHandler,
37-
onClearAllOverrides = {}
37+
onClearAllOverrides = {},
3838
)
3939
}
4040

@@ -54,7 +54,7 @@ class ResetServerIPOverridesConfirmationDialogTest {
5454
setContentWithTheme {
5555
ResetServerIpOverridesConfirmationDialog(
5656
onNavigateBack = {},
57-
onClearAllOverrides = clickHandler
57+
onClearAllOverrides = clickHandler,
5858
)
5959
}
6060

android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/dialog/SaveApiAccessMethodDialogTest.kt

+7-7
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class SaveApiAccessMethodDialogTest {
2929
state =
3030
SaveApiAccessMethodUiState(
3131
testingState = TestApiAccessMethodState.Testing,
32-
isSaving = false
32+
isSaving = false,
3333
)
3434
)
3535
}
@@ -48,7 +48,7 @@ class SaveApiAccessMethodDialogTest {
4848
state =
4949
SaveApiAccessMethodUiState(
5050
testingState = TestApiAccessMethodState.Result.Failure,
51-
isSaving = false
51+
isSaving = false,
5252
)
5353
)
5454
}
@@ -67,7 +67,7 @@ class SaveApiAccessMethodDialogTest {
6767
state =
6868
SaveApiAccessMethodUiState(
6969
testingState = TestApiAccessMethodState.Result.Successful,
70-
isSaving = true
70+
isSaving = true,
7171
)
7272
)
7373
}
@@ -87,9 +87,9 @@ class SaveApiAccessMethodDialogTest {
8787
state =
8888
SaveApiAccessMethodUiState(
8989
testingState = TestApiAccessMethodState.Testing,
90-
isSaving = false
90+
isSaving = false,
9191
),
92-
onCancel = onCancelClick
92+
onCancel = onCancelClick,
9393
)
9494
}
9595

@@ -110,9 +110,9 @@ class SaveApiAccessMethodDialogTest {
110110
state =
111111
SaveApiAccessMethodUiState(
112112
testingState = TestApiAccessMethodState.Result.Failure,
113-
isSaving = false
113+
isSaving = false,
114114
),
115-
onSave = onSaveClick
115+
onSave = onSaveClick,
116116
)
117117
}
118118

0 commit comments

Comments
 (0)