Skip to content

Commit 6923d9a

Browse files
committed
Ktlint fixes
1 parent 241b1a6 commit 6923d9a

3 files changed

Lines changed: 17 additions & 29 deletions

File tree

.trunk/trunk.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ lint:
2929
- actionlint@1.7.7
3030
- checkov@3.2.470
3131
- git-diff-check
32-
- ktlint@0.48.2
32+
- ktlint@1.7.1
3333
- markdownlint@0.45.0
3434
- prettier@3.6.2
3535
- shellcheck@0.11.0
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
package com.mparticle.rokt
22

3-
data class PlacementOptions(
4-
val jointSdkSelectPlacements: Long,
5-
val dynamicPerformanceMarkers: MutableMap<String, Long> = mutableMapOf(),
6-
)
3+
data class PlacementOptions(val jointSdkSelectPlacements: Long, val dynamicPerformanceMarkers: MutableMap<String, Long> = mutableMapOf())

android-kit-base/src/main/kotlin/com/mparticle/kits/RoktKitApiImpl.kt

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ import java.util.Objects
2626
* This class handles user resolution and attribute preparation before delegating
2727
* to the underlying Rokt Kit implementation.
2828
*/
29-
internal class RoktKitApiImpl(
30-
private val roktListener: KitIntegration.RoktListener,
31-
private val kitIntegration: KitIntegration,
32-
) : RoktKitApi {
29+
internal class RoktKitApiImpl(private val roktListener: KitIntegration.RoktListener, private val kitIntegration: KitIntegration) : RoktKitApi {
3330

3431
override fun execute(
3532
viewName: String,
@@ -70,14 +67,12 @@ internal class RoktKitApiImpl(
7067
}
7168
}
7269

73-
override fun events(identifier: String): Flow<RoktEvent> {
74-
return try {
75-
Logger.verbose("Calling events for Rokt Kit with identifier: $identifier")
76-
roktListener.events(identifier)
77-
} catch (e: Exception) {
78-
Logger.warning("Failed to call events for Rokt Kit: ${e.message}")
79-
flowOf()
80-
}
70+
override fun events(identifier: String): Flow<RoktEvent> = try {
71+
Logger.verbose("Calling events for Rokt Kit with identifier: $identifier")
72+
roktListener.events(identifier)
73+
} catch (e: Exception) {
74+
Logger.warning("Failed to call events for Rokt Kit: ${e.message}")
75+
flowOf()
8176
}
8277

8378
override fun purchaseFinalized(placementId: String, catalogItemId: String, status: Boolean) {
@@ -104,13 +99,11 @@ internal class RoktKitApiImpl(
10499
}
105100
}
106101

107-
override fun getSessionId(): String? {
108-
return try {
109-
roktListener.sessionId
110-
} catch (e: Exception) {
111-
Logger.warning("Failed to call getSessionId for Rokt Kit: ${e.message}")
112-
null
113-
}
102+
override fun getSessionId(): String? = try {
103+
roktListener.sessionId
104+
} catch (e: Exception) {
105+
Logger.warning("Failed to call getSessionId for Rokt Kit: ${e.message}")
106+
null
114107
}
115108

116109
override fun prepareAttributesAsync(attributes: Map<String, String>) {
@@ -149,10 +142,7 @@ internal class RoktKitApiImpl(
149142
return null
150143
}
151144

152-
private fun prepareAttributes(
153-
finalAttributes: MutableMap<String, String>,
154-
user: MParticleUser?,
155-
): MutableMap<String, String> {
145+
private fun prepareAttributes(finalAttributes: MutableMap<String, String>, user: MParticleUser?): MutableMap<String, String> {
156146
val kitConfig = kitIntegration.configuration
157147
val jsonArray = try {
158148
kitConfig?.placementAttributesMapping ?: org.json.JSONArray()
@@ -227,7 +217,8 @@ internal class RoktKitApiImpl(
227217
} else if (hashedEmailMismatch && existingHashedEmail != null) {
228218
// If there's an existing other but it doesn't match the passed-in hashed email, log a warning
229219
Logger.warning(
230-
"The existing hashed email on the user ($existingHashedEmail) does not match the hashed email passed to selectPlacements ($hashedEmail). " +
220+
"The existing hashed email on the user ($existingHashedEmail) does not match " +
221+
"the hashed email passed to selectPlacements ($hashedEmail). " +
231222
"Please make sure to sync the hashed email identity to mParticle as soon as it's available. " +
232223
"Identifying user with the provided hashed email before continuing to selectPlacements.",
233224
)

0 commit comments

Comments
 (0)