Skip to content

Commit 1b58173

Browse files
committed
remove trailing comma, lint
Signed-off-by: Adam Ratzman <[email protected]>
1 parent c955ddb commit 1b58173

File tree

24 files changed

+35
-43
lines changed

24 files changed

+35
-43
lines changed

src/androidMain/kotlin/com/adamratzman/spotify/auth/SpotifyDefaultCredentialStore.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,7 @@ public class SpotifyDefaultCredentialStore(
194194
public fun canApiBeRefreshed(): Boolean {
195195
return spotifyRefreshToken != null
196196
}
197-
198-
197+
199198
/**
200199
* Clear the [SharedPreferences] instance corresponding to the Spotify credentials.
201200
*/

src/androidMain/kotlin/com/adamratzman/spotify/utils/PlatformUtils.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ import android.app.Activity
55
import android.content.Context
66
import android.util.Log
77
import android.widget.Toast
8-
import kotlinx.coroutines.CoroutineScope
9-
import kotlinx.coroutines.runBlocking
108
import java.net.URLEncoder
9+
import kotlinx.coroutines.runBlocking
1110

1211
internal actual fun String.encodeUrl() = URLEncoder.encode(this, "UTF-8")!!
1312

@@ -38,4 +37,4 @@ internal fun logToConsole(message: String) {
3837

3938
public actual fun <T> runBlockingOnJvmAndNative(block: suspend () -> T): T {
4039
return runBlocking { block() }
41-
}
40+
}

src/commonJvmLikeMain/kotlin/com/adamratzman/spotify/javainterop/SpotifyContinuation.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* Spotify Web API, Kotlin Wrapper; MIT License, 2017-2021; Original author: Adam Ratzman */
12
@file:JvmName("SpotifyContinuation")
23

34
package com.adamratzman.spotify.javainterop
@@ -31,4 +32,4 @@ public abstract class SpotifyContinuation<in T> : Continuation<T> {
3132
}
3233

3334
override val context: CoroutineContext = EmptyCoroutineContext
34-
}
35+
}

src/commonMain/kotlin/com.adamratzman.spotify/SpotifyApi.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ import com.adamratzman.spotify.models.serialization.nonstrictJson
3636
import com.adamratzman.spotify.models.serialization.toObject
3737
import com.adamratzman.spotify.utils.asList
3838
import com.adamratzman.spotify.utils.base64ByteEncode
39-
import kotlinx.serialization.json.Json
4039
import kotlin.jvm.JvmOverloads
40+
import kotlinx.serialization.json.Json
4141

4242
/**
4343
* Represents an instance of the Spotify API client, with common
@@ -781,5 +781,3 @@ public fun refreshSpotifyClientTokenRestAction(
781781
usesPkceAuth: Boolean
782782
): SpotifyRestAction<Token> =
783783
SpotifyRestAction { refreshSpotifyClientToken(clientId, clientSecret, refreshToken, usesPkceAuth) }
784-
785-

src/commonMain/kotlin/com.adamratzman.spotify/SpotifyApiBuilder.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,13 @@ public fun getSpotifyPkceCodeChallenge(codeVerifier: String): String {
113113
*/
114114
public fun spotifyImplicitGrantApi(
115115
clientId: String?,
116-
token: Token,
116+
token: Token
117117
): SpotifyImplicitGrantApi = SpotifyImplicitGrantApi(
118118
clientId,
119119
token,
120120
SpotifyApiOptions()
121121
)
122122

123-
124123
/**
125124
* Instantiate a new [SpotifyImplicitGrantApi] using a Spotify [clientId], and [token] retrieved from the implicit
126125
* grant flow.
@@ -323,7 +322,6 @@ public fun spotifyClientApi(
323322
}
324323
}
325324

326-
327325
/**
328326
* Instantiate a new [SpotifyClientApiBuilder] using a Spotify [clientId], [clientSecret], and [redirectUri], with the ability to configure
329327
* the api settings by providing a builder initialization [block]
@@ -707,7 +705,7 @@ public class SpotifyApiBuilder(
707705
/**
708706
* Create a new [SpotifyAppApi] that only has access to *public* endpoints and data
709707
*/
710-
public fun buildPublicRestAction(): SpotifyRestAction<SpotifyAppApi> = SpotifyRestAction{ buildPublic() }
708+
public fun buildPublicRestAction(): SpotifyRestAction<SpotifyAppApi> = SpotifyRestAction { buildPublic() }
711709

712710
/**
713711
* Create a new [SpotifyAppApi] that only has access to *public* endpoints and data

src/commonMain/kotlin/com.adamratzman.spotify/SpotifyRestAction.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
/* Spotify Web API, Kotlin Wrapper; MIT License, 2017-2020; Original author: Adam Ratzman */
1+
/* Spotify Web API, Kotlin Wrapper; MIT License, 2017-2021; Original author: Adam Ratzman */
22
package com.adamratzman.spotify
33

44
import com.adamratzman.spotify.utils.TimeUnit
55
import com.adamratzman.spotify.utils.getCurrentTimeMs
66
import com.adamratzman.spotify.utils.runBlockingOnJvmAndNative
7+
import kotlin.coroutines.CoroutineContext
8+
import kotlin.coroutines.resume
9+
import kotlin.coroutines.resumeWithException
10+
import kotlin.coroutines.suspendCoroutine
11+
import kotlin.jvm.JvmOverloads
712
import kotlinx.coroutines.CancellationException
813
import kotlinx.coroutines.CoroutineScope
914
import kotlinx.coroutines.Dispatchers
1015
import kotlinx.coroutines.GlobalScope
1116
import kotlinx.coroutines.delay
1217
import kotlinx.coroutines.launch
1318
import kotlinx.coroutines.withContext
14-
import kotlin.coroutines.CoroutineContext
15-
import kotlin.coroutines.resume
16-
import kotlin.coroutines.resumeWithException
17-
import kotlin.coroutines.suspendCoroutine
18-
import kotlin.jvm.JvmOverloads
1919

2020
/**
2121
* Provides a uniform interface to retrieve, whether synchronously or asynchronously, [T] from Spotify
@@ -123,4 +123,4 @@ public open class SpotifyRestAction<T> internal constructor(public val supplier:
123123
}
124124

125125
override fun toString(): String = complete().toString()
126-
}
126+
}

src/commonMain/kotlin/com.adamratzman.spotify/endpoints/client/ClientLibraryApi.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public class ClientLibraryApi(api: GenericSpotifyApi) : SpotifyEndpoint(api) {
6969
limit: Int? = api.spotifyApiOptions.defaultLimit,
7070
offset: Int? = null,
7171
market: Market? = null
72-
): SpotifyRestAction<PagingObject<SavedTrack>> = SpotifyRestAction { getSavedTracks(limit, offset, market) }
72+
): SpotifyRestAction<PagingObject<SavedTrack>> = SpotifyRestAction { getSavedTracks(limit, offset, market) }
7373

7474
/**
7575
* Get a list of the albums saved in the current Spotify user’s ‘Your Music’ library.
@@ -186,7 +186,7 @@ public class ClientLibraryApi(api: GenericSpotifyApi) : SpotifyEndpoint(api) {
186186
* @throws BadRequestException if any of the provided ids is invalid
187187
*/
188188
public fun containsRestAction(type: LibraryType, vararg ids: String): SpotifyRestAction<List<Boolean>> {
189-
return SpotifyRestAction { contains(type, *ids)}
189+
return SpotifyRestAction { contains(type, *ids) }
190190
}
191191

192192
/**
@@ -215,8 +215,7 @@ public class ClientLibraryApi(api: GenericSpotifyApi) : SpotifyEndpoint(api) {
215215
*
216216
* @throws BadRequestException if the id is invalid
217217
*/
218-
public fun addRestAction(type: LibraryType, id: String): SpotifyRestAction<Unit> = SpotifyRestAction { add(type, id)}
219-
218+
public fun addRestAction(type: LibraryType, id: String): SpotifyRestAction<Unit> = SpotifyRestAction { add(type, id) }
220219

221220
/**
222221
* Save one or more of [LibraryType] to the current user’s ‘Your Music’ library.
@@ -288,7 +287,6 @@ public class ClientLibraryApi(api: GenericSpotifyApi) : SpotifyEndpoint(api) {
288287
*/
289288
public fun removeRestAction(type: LibraryType, id: String): SpotifyRestAction<Unit> = SpotifyRestAction { remove(type, ids = arrayOf(id)) }
290289

291-
292290
/**
293291
* Remove one or more of the [LibraryType] (tracks or albums) from the current user’s ‘Your Music’ library.
294292
*

src/commonMain/kotlin/com.adamratzman.spotify/endpoints/pub/BrowseApi.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ import com.adamratzman.spotify.utils.Locale
2323
import com.adamratzman.spotify.utils.Market
2424
import com.adamratzman.spotify.utils.encodeUrl
2525
import com.adamratzman.spotify.utils.formatDate
26+
import kotlin.reflect.KClass
2627
import kotlinx.serialization.Serializable
2728
import kotlinx.serialization.builtins.ListSerializer
2829
import kotlinx.serialization.builtins.serializer
29-
import kotlin.reflect.KClass
3030

3131
/**
3232
* Endpoints for getting playlists and new album releases featured on Spotify’s Browse tab.

src/commonMain/kotlin/com.adamratzman.spotify/endpoints/pub/SearchApi.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public open class SearchApi(api: GenericSpotifyApi) : SpotifyEndpoint(api) {
193193
offset: Int? = null,
194194
market: Market? = null,
195195
includeExternal: Boolean? = null
196-
): SpotifyRestAction<SpotifySearchResult> = SpotifyRestAction { search(query, *searchTypes,limit= limit,offset= offset, market=market, includeExternal = includeExternal) }
196+
): SpotifyRestAction<SpotifySearchResult> = SpotifyRestAction { search(query, *searchTypes, limit = limit, offset = offset, market = market, includeExternal = includeExternal) }
197197

198198
/**
199199
* Get Spotify Catalog information about playlists that match the keyword string. See [SearchApi.search] for more information

src/commonMain/kotlin/com.adamratzman.spotify/http/Endpoints.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ import com.adamratzman.spotify.models.ErrorResponse
1111
import com.adamratzman.spotify.models.serialization.toObject
1212
import com.adamratzman.spotify.utils.ConcurrentHashMap
1313
import com.adamratzman.spotify.utils.getCurrentTimeMs
14+
import kotlin.math.ceil
1415
import kotlinx.coroutines.CancellationException
1516
import kotlinx.coroutines.async
1617
import kotlinx.coroutines.awaitAll
1718
import kotlinx.coroutines.coroutineScope
1819
import kotlinx.coroutines.withTimeout
1920
import kotlinx.serialization.Serializable
2021
import kotlinx.serialization.Transient
21-
import kotlin.math.ceil
2222

2323
public abstract class SpotifyEndpoint(public val api: GenericSpotifyApi) {
2424
public val cache: SpotifyCache = SpotifyCache()

0 commit comments

Comments
 (0)