Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

up detekt to 1.19 and fix some warnings #116

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ plugins {

detekt {
toolVersion = libs.versions.detekt.get()
input = files(subprojects.map {
source = files(subprojects.map {
File(it.projectDir, "/src/main/kotlin")
})
buildUponDefaultConfig = true
config = files("$projectDir/detekt-config.yml")
baseline = file("$projectDir/detekt-baseline.xml")

reports {
html.enabled = true
xml.enabled = true
html.required.set(true)
xml.required.set(true)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

withVersionCatalog { libs ->
configure<AppExtension>() {
configure<AppExtension> {
defaultConfig {
targetSdk = libs.versions.targetSdk.get().toInt()
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ configure<PublishingExtension> {
}

plugins.withId("com.android.library") {
configure<LibraryExtension>() {
configure<LibraryExtension> {
publishing {
singleVariant("release") {
withJavadocJar()
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ compileSdk = "34"
minSdk = "14"

agpVersion = "8.2.1"
kotlinVersion = "1.9.21"
kotlinVersion = "1.9.22"

dokkaVersion = "1.9.10"
appcompatVersion = "1.6.1"
Expand All @@ -25,7 +25,7 @@ junitExtVersion = "1.1.5"
multidexVersion = "2.0.1"
materialVersion = "1.11.0"

detekt = "1.17.1"
detekt = "1.19.0"

githubApiVersion = "1.318"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ interface ChipGroupActions : BaseActions {
}
}
}

})
}

Expand All @@ -54,14 +53,13 @@ interface ChipGroupActions : BaseActions {
chip.performClick()
}
}

})
}

/**
* Select a Chip in a ChipGroup at a particular index
*
* @param index ChipGroup Chip indes
* @param index ChipGroup Chip index
*/
fun selectChipAt(index: Int) {
view.perform(object : ViewAction {
Expand All @@ -80,7 +78,6 @@ interface ChipGroupActions : BaseActions {
}
}
}

})
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
package io.github.kakaocup.kakao.common.actions

import android.view.View
import androidx.test.espresso.FailureHandler
import androidx.test.espresso.ViewAction
import androidx.test.espresso.action.CoordinatesProvider
import androidx.test.espresso.action.GeneralLocation
Expand Down Expand Up @@ -82,7 +81,7 @@ interface BaseActions {
* @param function Lambda that handles this view's errors
*/
fun onFailure(function: (error: Throwable, matcher: Matcher<View>) -> Unit) {
view.withFailureHandler(FailureHandler { error, viewMatcher -> function(error, viewMatcher) })
view.withFailureHandler { error, viewMatcher -> function(error, viewMatcher) }
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import io.github.kakaocup.kakao.common.utilities.getResourceDrawable
import org.hamcrest.Description
import org.hamcrest.TypeSafeMatcher


/**
* Matches given drawable with current one
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import org.hamcrest.Description
*
* @see Chip
*/
class SelectedChipMatcher() :
class SelectedChipMatcher :
BoundedMatcher<View, Chip>(Chip::class.java) {
override fun describeTo(description: Description) {
description.appendText("Chip is checked")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ import org.hamcrest.Matchers
/**
* Base class for all Kakao views
*
* This base class allows create new custom view with ease. All you
* This base class allows to create new custom view with ease. All you
* have to do is to extend this class, implement all necessarily additional
* actions/assertions interfaces and override necessary constructors
*
* @param T Type of your custom view. Needs to be defined to enable invoke() and perform() for descendants
*/
@KakaoDslMarker
open class KBaseView<T> : KDSLView<T>, BaseActions, BaseAssertions, Interceptable<ViewInteraction, ViewAssertion, ViewAction> {
override val view: ViewInteractionDelegate
final override val view: ViewInteractionDelegate
override var root: Matcher<Root> = RootMatchers.DEFAULT

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class KViewPager2 : ViewPager2Actions, ViewPager2AdapterAssertions, SwipeableAct

try {
scrollTo(position)
} catch (error: Throwable) {
} catch (_: Throwable) {
}

val vb = ViewBuilder().apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ import androidx.test.espresso.action.Swiper
import androidx.test.espresso.core.internal.deps.guava.base.Preconditions.checkElementIndex

object PreciseSwipe : Swiper {

private const val EVENT_COUNT = 40
private const val DURATION_MS = 1000L
private const val TAG = "PreciseSwipe"

override fun sendSwipe(
uiController: UiController, startCoordinates: FloatArray,
endCoordinates: FloatArray, precision: FloatArray
): Swiper.Status {
checkNotNull(uiController)
checkNotNull(startCoordinates)
checkNotNull(endCoordinates)
checkNotNull(precision)

val steps = interpolate(startCoordinates, endCoordinates, EVENT_COUNT)
val delayBetweenMovements = DURATION_MS / steps.size
Expand Down Expand Up @@ -65,9 +66,4 @@ object PreciseSwipe : Swiper {

return res
}

private const val EVENT_COUNT = 40
private const val DURATION_MS = 1000L
private const val TAG = "PreciseSwipe"

}
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class KRecyclerView : RecyclerActions, BaseAssertions, RecyclerAdapterAssertions

try {
scrollTo(position)
} catch (error: Throwable) {
} catch (_: Throwable) {
}

function((provideItem(PositionMatcher(matcher, position)) as T).also { inRoot { withMatcher([email protected]) } })
Expand Down Expand Up @@ -162,7 +162,7 @@ class KRecyclerView : RecyclerActions, BaseAssertions, RecyclerAdapterAssertions

try {
scrollTo(childMatcher)
} catch (error: Throwable) {
} catch (_: Throwable) {
}

return (provideItem(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ open class Screen<out T : Screen<T>> : ScreenActions {
}

companion object {
internal val viewInterceptors: Deque<Interceptor<ViewInteraction, ViewAssertion, ViewAction>> = LinkedList()
internal val dataInterceptors: Deque<Interceptor<DataInteraction, ViewAssertion, ViewAction>> = LinkedList()
internal val webInterceptors: Deque<Interceptor<Web.WebInteraction<*>, WebAssertion<*>, Atom<*>>> = LinkedList()

/**
* Idles for given amount of time
*
Expand Down Expand Up @@ -167,9 +171,5 @@ open class Screen<out T : Screen<T>> : ScreenActions {
.newInstance()
.apply { this(function) }
}

internal val viewInterceptors: Deque<Interceptor<ViewInteraction, ViewAssertion, ViewAction>> = LinkedList()
internal val dataInterceptors: Deque<Interceptor<DataInteraction, ViewAssertion, ViewAction>> = LinkedList()
internal val webInterceptors: Deque<Interceptor<Web.WebInteraction<*>, WebAssertion<*>, Atom<*>>> = LinkedList()
}
}