Skip to content

Commit

Permalink
Merge pull request #7500 from TacoTheDank/bumpKtlint
Browse files Browse the repository at this point in the history
Bump ktlint, Checkstyle, Java version
  • Loading branch information
litetex authored Dec 12, 2021
2 parents 4e6dcc6 + f86fc03 commit b056faa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 21 deletions.
23 changes: 11 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
plugins {
id "org.sonarqube" version "3.1.1"
id "com.android.application"
id "kotlin-android"
id "kotlin-kapt"
id "kotlin-parcelize"
id "checkstyle"
id "org.sonarqube" version "3.3"
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-parcelize'
apply plugin: 'kotlin-kapt'
apply plugin: 'checkstyle'

android {
compileSdkVersion 30
buildToolsVersion '30.0.3'
Expand Down Expand Up @@ -80,13 +79,13 @@ android {
// Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled true

sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
encoding 'utf-8'
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
jvmTarget = JavaVersion.VERSION_11
}

sourceSets {
Expand All @@ -99,7 +98,7 @@ android {
}

ext {
checkstyleVersion = '8.38'
checkstyleVersion = '9.2'

androidxLifecycleVersion = '2.3.1'
androidxRoomVersion = '2.3.0'
Expand Down Expand Up @@ -193,7 +192,7 @@ dependencies {

/** Checkstyle **/
checkstyle "com.puppycrawl.tools:checkstyle:${checkstyleVersion}"
ktlint 'com.pinterest:ktlint:0.40.0'
ktlint 'com.pinterest:ktlint:0.43.2'

/** Kotlin **/
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlin_version}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,28 +183,23 @@ class FeedLoadService : Service() {

subscriptions
.take(1)

.doOnNext {
currentProgress.set(0)
maxProgress.set(it.size)
}
.filter { it.isNotEmpty() }

.observeOn(AndroidSchedulers.mainThread())
.doOnNext {
startForeground(NOTIFICATION_ID, notificationBuilder.build())
updateNotificationProgress(null)
broadcastProgress()
}

.observeOn(Schedulers.io())
.flatMap { Flowable.fromIterable(it) }
.takeWhile { !cancelSignal.get() }

.parallel(PARALLEL_EXTRACTIONS, PARALLEL_EXTRACTIONS * 2)
.runOn(Schedulers.io(), PARALLEL_EXTRACTIONS * 2)
.filter { !cancelSignal.get() }

.map { subscriptionEntity ->
var error: Throwable? = null
try {
Expand Down Expand Up @@ -239,14 +234,11 @@ class FeedLoadService : Service() {
}
}
.sequential()

.observeOn(AndroidSchedulers.mainThread())
.doOnNext(notificationsConsumer)

.observeOn(Schedulers.io())
.buffer(BUFFER_COUNT_BEFORE_INSERT)
.doOnNext(databaseConsumer)

.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(resultSubscriber)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mockito
import org.mockito.Mockito.`when`
import org.mockito.Mockito.anyBoolean
import org.mockito.Mockito.anyInt
import org.mockito.Mockito.anyString
import org.mockito.Mockito.atLeastOnce
import org.mockito.Mockito.verify
import org.mockito.Mockito.`when`
import org.mockito.Mockito.withSettings
import org.mockito.junit.MockitoJUnitRunner
import org.schabi.newpipe.streams.io.StoredFileHelper
Expand Down

0 comments on commit b056faa

Please sign in to comment.