Skip to content

Commit dc25e7b

Browse files
authored
Update KTLint (#585)
1 parent 846a6f1 commit dc25e7b

File tree

385 files changed

+1597
-1374
lines changed

Some content is hidden

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

385 files changed

+1597
-1374
lines changed

.editorconfig

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
1-
[*.{kt,kts}]
1+
root = true
22

3-
ktlint_disabled_rules=no-wildcard-imports,max-line-length
3+
[*]
4+
ij_continuation_indent_size = 4
45

6+
[*.{kt,kts}]
7+
ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL
58
# Imports must be ordered in lexicographic order without any empty lines in-between.
69
# https://github.com/pinterest/ktlint/issues/1236
710
ij_kotlin_imports_layout=*
11+
ktlint_code_style = intellij_idea
12+
ktlint_standard_no-wildcard-imports = disabled
13+
ktlint_standard_max-line-length = disabled
14+
15+
ktlint_standard_class-naming = disabled
16+
ktlint_standard_comment-wrapping = disabled
17+
ktlint_standard_discouraged-comment-location = disabled
18+
ktlint_standard_function-naming = disabled
19+
ktlint_standard_property-naming = disabled
20+
ktlint_standard_trailing-comma-on-call-site = disabled

gradle/libs.versions.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ androidx-lifecycle = "2.8.7"
2525
androidx-media = "1.7.0"
2626
androidx-media2 = "1.3.0"
2727
androidx-media3 = "1.4.1"
28-
androidx-navigation = "2.8.3"
29-
androidx-paging = "3.3.2"
28+
androidx-navigation = "2.8.4"
29+
androidx-paging = "3.3.4"
3030
androidx-recyclerview = "1.3.2"
3131
androidx-room = "2.6.1"
3232
androidx-viewpager2 = "1.1.0"
@@ -52,7 +52,7 @@ kotlinx-serialization-json = "1.7.3"
5252
# See https://github.com/google/ksp/releases
5353
ksp = "2.0.21-1.0.25"
5454

55-
ktlint = "11.5.1"
55+
ktlint = "12.1.1"
5656

5757
# We cannot upgrade to 1.9.0 as it conflicts with liblcp.
5858
# See https://github.com/readium/kotlin-toolkit/issues/29

readium/adapters/exoplayer/audio/src/main/java/org/readium/adapter/exoplayer/audio/DefaultExoPlayerCacheProvider.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import org.readium.r2.shared.util.toUrl
1717
*/
1818
@OptIn(UnstableApi::class)
1919
public class DefaultExoPlayerCacheProvider(
20-
private val cache: Cache
20+
private val cache: Cache,
2121
) : ExoPlayerCacheProvider {
2222

2323
@kotlin.OptIn(DelicateReadiumApi::class)
@@ -30,7 +30,7 @@ public class DefaultExoPlayerCacheProvider(
3030

3131
@OptIn(UnstableApi::class)
3232
public fun ExoPlayerCacheProvider.createCacheDataSourceFactory(
33-
publication: Publication
33+
publication: Publication,
3434
): CacheDataSource.Factory? {
3535
val cache = getCache(publication) ?: return null
3636
val upstreamDataSourceFactory = ExoPlayerDataSource.Factory(publication)

readium/adapters/exoplayer/audio/src/main/java/org/readium/adapter/exoplayer/audio/ExoAudiobookPlayer.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ internal class ExoAudiobookPlayer(
2222
private val player: ExoPlayer,
2323
private val itemDurations: List<Duration>?,
2424
private val seekForwardIncrement: Duration,
25-
private val seekBackwardIncrement: Duration
25+
private val seekBackwardIncrement: Duration,
2626
) : ForwardingPlayer(player) {
2727

2828
fun seekBy(offset: Duration) {
@@ -46,7 +46,7 @@ internal class ExoAudiobookPlayer(
4646
@OptIn(ExperimentalTime::class)
4747
private fun smartSeekBy(
4848
offset: Duration,
49-
durations: List<Duration>
49+
durations: List<Duration>,
5050
) {
5151
val (newIndex, newPosition) =
5252
SmartSeeker.dispatchSeek(

readium/adapters/exoplayer/audio/src/main/java/org/readium/adapter/exoplayer/audio/ExoPlayerDataSource.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ import timber.log.Timber
2929
*/
3030
@androidx.annotation.OptIn(androidx.media3.common.util.UnstableApi::class)
3131
internal class ExoPlayerDataSource internal constructor(
32-
private val publication: Publication
32+
private val publication: Publication,
3333
) : BaseDataSource(/* isNetwork = */ true) {
3434

3535
class Factory(
3636
private val publication: Publication,
37-
private val transferListener: TransferListener? = null
37+
private val transferListener: TransferListener? = null,
3838
) : DataSource.Factory {
3939

4040
override fun createDataSource(): DataSource =
@@ -49,7 +49,7 @@ internal class ExoPlayerDataSource internal constructor(
4949
val resource: Resource,
5050
val uri: Uri,
5151
var position: Long,
52-
var remaining: Long
52+
var remaining: Long,
5353
)
5454

5555
private var openedResource: OpenedResource? = null

readium/adapters/exoplayer/audio/src/main/java/org/readium/adapter/exoplayer/audio/ExoPlayerDefaults.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ package org.readium.adapter.exoplayer.audio
1616
*/
1717
public data class ExoPlayerDefaults(
1818
val pitch: Double? = null,
19-
val speed: Double? = null
19+
val speed: Double? = null,
2020
) {
2121
init {
2222
require(pitch == null || pitch > 0)

readium/adapters/exoplayer/audio/src/main/java/org/readium/adapter/exoplayer/audio/ExoPlayerEngine.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public class ExoPlayerEngine private constructor(
5454
private val exoPlayer: ExoAudiobookPlayer,
5555
private val settingsResolver: SettingsResolver,
5656
private val configuration: Configuration,
57-
initialPreferences: ExoPlayerPreferences
57+
initialPreferences: ExoPlayerPreferences,
5858
) : AudioEngine<ExoPlayerSettings, ExoPlayerPreferences> {
5959

6060
public companion object {
@@ -67,7 +67,7 @@ public class ExoPlayerEngine private constructor(
6767
configuration: Configuration,
6868
initialIndex: Int,
6969
initialPosition: Duration,
70-
initialPreferences: ExoPlayerPreferences
70+
initialPreferences: ExoPlayerPreferences,
7171
): ExoPlayerEngine {
7272
val exoPlayer = ExoPlayer.Builder(application)
7373
.setMediaSourceFactory(DefaultMediaSourceFactory(dataSourceFactory))
@@ -143,18 +143,18 @@ public class ExoPlayerEngine private constructor(
143143
public data class Configuration(
144144
val positionRefreshRate: Hz = 2.0.hz,
145145
val seekBackwardIncrement: Duration = 15.seconds,
146-
val seekForwardIncrement: Duration = 30.seconds
146+
val seekForwardIncrement: Duration = 30.seconds,
147147
)
148148

149149
public data class Playlist(
150150
val mediaMetadata: MediaMetadata,
151151
val duration: Duration?,
152-
val items: List<Item>
152+
val items: List<Item>,
153153
) {
154154
public data class Item(
155155
val url: Url,
156156
val mediaMetadata: MediaMetadata,
157-
val duration: Duration?
157+
val duration: Duration?,
158158
)
159159
}
160160

@@ -184,7 +184,7 @@ public class ExoPlayerEngine private constructor(
184184

185185
public sealed class Error(
186186
override val message: String,
187-
override val cause: org.readium.r2.shared.util.Error?
187+
override val cause: org.readium.r2.shared.util.Error?,
188188
) : AudioEngine.Error {
189189

190190
public data class Engine(override val cause: ThrowableError<ExoPlaybackException>) :

readium/adapters/exoplayer/audio/src/main/java/org/readium/adapter/exoplayer/audio/ExoPlayerEngineProvider.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ public class ExoPlayerEngineProvider(
3737
private val metadataProvider: MediaMetadataProvider = DefaultMediaMetadataProvider(),
3838
private val cacheProvider: ExoPlayerCacheProvider? = null,
3939
private val defaults: ExoPlayerDefaults = ExoPlayerDefaults(),
40-
private val configuration: ExoPlayerEngine.Configuration = ExoPlayerEngine.Configuration()
40+
private val configuration: ExoPlayerEngine.Configuration = ExoPlayerEngine.Configuration(),
4141
) : AudioEngineProvider<ExoPlayerSettings, ExoPlayerPreferences, ExoPlayerPreferencesEditor> {
4242

4343
override suspend fun createEngine(
4444
publication: Publication,
4545
initialLocator: Locator,
46-
initialPreferences: ExoPlayerPreferences
46+
initialPreferences: ExoPlayerPreferences,
4747
): Try<ExoPlayerEngine, Nothing> {
4848
val metadataFactory = metadataProvider.createMetadataFactory(publication)
4949
val settingsResolver = ExoPlayerSettingsResolver(defaults)
@@ -80,7 +80,7 @@ public class ExoPlayerEngineProvider(
8080

8181
override fun createPreferenceEditor(
8282
publication: Publication,
83-
initialPreferences: ExoPlayerPreferences
83+
initialPreferences: ExoPlayerPreferences,
8484
): ExoPlayerPreferencesEditor =
8585
ExoPlayerPreferencesEditor(
8686
initialPreferences,

readium/adapters/exoplayer/audio/src/main/java/org/readium/adapter/exoplayer/audio/ExoPlayerPreferences.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import org.readium.r2.navigator.preferences.Configurable
1717
@kotlinx.serialization.Serializable
1818
public data class ExoPlayerPreferences(
1919
val pitch: Double? = null,
20-
val speed: Double? = null
20+
val speed: Double? = null,
2121
) : Configurable.Preferences<ExoPlayerPreferences> {
2222

2323
override fun plus(other: ExoPlayerPreferences): ExoPlayerPreferences =

readium/adapters/exoplayer/audio/src/main/java/org/readium/adapter/exoplayer/audio/ExoPlayerPreferencesEditor.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ import org.readium.r2.shared.publication.Metadata
2626
public class ExoPlayerPreferencesEditor(
2727
initialPreferences: ExoPlayerPreferences,
2828
@Suppress("UNUSED_PARAMETER") publicationMetadata: Metadata,
29-
defaults: ExoPlayerDefaults
29+
defaults: ExoPlayerDefaults,
3030
) : PreferencesEditor<ExoPlayerPreferences> {
3131

3232
private data class State(
3333
val preferences: ExoPlayerPreferences,
34-
val settings: ExoPlayerSettings
34+
val settings: ExoPlayerSettings,
3535
)
3636

3737
private val settingsResolver: ExoPlayerSettingsResolver =

0 commit comments

Comments
 (0)