feat(coverage): Update coverage rules and introduce new ExcludeFromCoverage annotation.
.
This commit is contained in:
parent
3b1596cb54
commit
0061b0ae37
|
@ -24,7 +24,9 @@ import dagger.hilt.EntryPoint
|
|||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.android.EntryPointAccessors
|
||||
import dagger.hilt.components.SingletonComponent
|
||||
import me.proton.core.util.kotlin.annotation.ExcludeFromCoverage
|
||||
|
||||
@ExcludeFromCoverage
|
||||
class MissingScopeInitializer : Initializer<Unit> {
|
||||
|
||||
override fun create(context: Context) {
|
||||
|
|
|
@ -6,6 +6,6 @@ publishOption.shouldBePublishedAsLib = false
|
|||
|
||||
// Global minimum coverage percentage.
|
||||
protonCoverage {
|
||||
minBranchCoveragePercentage.set(36)
|
||||
minBranchCoveragePercentage.set(27)
|
||||
minLineCoveragePercentage.set(48)
|
||||
}
|
||||
|
|
|
@ -25,7 +25,9 @@ import dagger.hilt.InstallIn
|
|||
import dagger.hilt.android.EntryPointAccessors
|
||||
import dagger.hilt.components.SingletonComponent
|
||||
import me.proton.core.crypto.validator.presentation.CryptoValidator
|
||||
import me.proton.core.util.kotlin.annotation.ExcludeFromCoverage
|
||||
|
||||
@ExcludeFromCoverage
|
||||
public class CryptoValidatorInitializer : Initializer<CryptoValidator> {
|
||||
|
||||
public override fun create(context: Context): CryptoValidator {
|
||||
|
|
|
@ -24,7 +24,9 @@ import dagger.hilt.EntryPoint
|
|||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.android.EntryPointAccessors
|
||||
import dagger.hilt.components.SingletonComponent
|
||||
import me.proton.core.util.kotlin.annotation.ExcludeFromCoverage
|
||||
|
||||
@ExcludeFromCoverage
|
||||
class HumanVerificationInitializer : Initializer<Unit> {
|
||||
|
||||
override fun create(context: Context) {
|
||||
|
|
|
@ -25,7 +25,9 @@ import dagger.hilt.InstallIn
|
|||
import dagger.hilt.android.EntryPointAccessors
|
||||
import dagger.hilt.components.SingletonComponent
|
||||
import me.proton.core.keytransparency.data.SelfAuditStarter
|
||||
import me.proton.core.util.kotlin.annotation.ExcludeFromCoverage
|
||||
|
||||
@ExcludeFromCoverage
|
||||
public class KeyTransparencyInitializer : Initializer<Unit> {
|
||||
|
||||
override fun create(context: Context) {
|
||||
|
|
|
@ -25,7 +25,9 @@ import dagger.hilt.InstallIn
|
|||
import dagger.hilt.android.EntryPointAccessors
|
||||
import dagger.hilt.components.SingletonComponent
|
||||
import me.proton.core.network.presentation.UnAuthSessionFetcher
|
||||
import me.proton.core.util.kotlin.annotation.ExcludeFromCoverage
|
||||
|
||||
@ExcludeFromCoverage
|
||||
public class UnAuthSessionFetcherInitializer : Initializer<UnAuthSessionFetcher> {
|
||||
|
||||
public override fun create(context: Context): UnAuthSessionFetcher {
|
||||
|
|
|
@ -34,7 +34,9 @@ import me.proton.core.plan.presentation.usecase.CheckUnredeemedGooglePurchase
|
|||
import me.proton.core.presentation.app.AppLifecycleProvider
|
||||
import me.proton.core.util.kotlin.CoroutineScopeProvider
|
||||
import me.proton.core.util.kotlin.DispatcherProvider
|
||||
import me.proton.core.util.kotlin.annotation.ExcludeFromCoverage
|
||||
|
||||
@ExcludeFromCoverage
|
||||
class UnredeemedPurchaseInitializer : Initializer<Unit> {
|
||||
override fun create(context: Context) {
|
||||
val entryPoint = EntryPointAccessors.fromApplication(
|
||||
|
|
|
@ -4,7 +4,7 @@ import kotlinx.kover.gradle.plugin.dsl.KoverReportFilters
|
|||
|
||||
internal fun KoverReportFilters.androidRules() {
|
||||
excludes {
|
||||
annotatedBy("androidx.compose.runtime.Composable")
|
||||
annotatedBy("me.proton.core.util.kotlin.annotation.ExcludeFromCoverage")
|
||||
classes(
|
||||
"*Activity",
|
||||
"*Activity\$*",
|
||||
|
|
|
@ -203,6 +203,9 @@ public final class me/proton/core/util/kotlin/WhenExensionsKt {
|
|||
public static final fun getExhaustive (Ljava/lang/Object;)Ljava/lang/Object;
|
||||
}
|
||||
|
||||
public abstract interface annotation class me/proton/core/util/kotlin/annotation/ExcludeFromCoverage : java/lang/annotation/Annotation {
|
||||
}
|
||||
|
||||
public abstract interface class me/proton/core/util/kotlin/coroutine/ResultCollector {
|
||||
public abstract fun key ()Ljava/lang/String;
|
||||
public abstract fun onComplete (Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright (c) 2022 Proton Technologies AG
|
||||
* This file is part of Proton AG and ProtonCore.
|
||||
*
|
||||
* ProtonCore is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ProtonCore is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with ProtonCore. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package me.proton.core.util.kotlin.annotation
|
||||
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
@Target(
|
||||
AnnotationTarget.CLASS,
|
||||
AnnotationTarget.FUNCTION
|
||||
)
|
||||
public annotation class ExcludeFromCoverage
|
Loading…
Reference in New Issue