From dba46c266c1fae278e2ceae21eddc8dddc9ef197 Mon Sep 17 00:00:00 2001 From: Carter Jernigan Date: Wed, 31 May 2023 06:38:42 -0400 Subject: [PATCH] Dependency updates (#1064) * [#1060] Detekt 1.23.0 * [#1060] Refactor Detekt integration Use a convention plugin to be consistent with our other projects. Also added the Compose Detekt rules. * [#1061] Ktlint 0.49.1 * [#1012] Emulator.wtf Gradle plugin 0.12.2 * [#1062] Foojay resolver 0.5.0 * [#1055] Remove kapt from darkside-test * [#1063] Flank 23.04.0 --- build-conventions/build.gradle.kts | 3 +- build-conventions/gradle.lockfile | 12 +- build-conventions/gradle.properties | 2 +- .../zcash-sdk.detekt-conventions.gradle.kts | 38 + build.gradle.kts | 16 +- darkside-test-lib/build.gradle.kts | 1 - gradle.properties | 11 +- tools/detekt-baseline.xml | 52 ++ tools/detekt.yml | 714 +----------------- 9 files changed, 120 insertions(+), 729 deletions(-) create mode 100644 build-conventions/src/main/kotlin/zcash-sdk.detekt-conventions.gradle.kts create mode 100644 tools/detekt-baseline.xml diff --git a/build-conventions/build.gradle.kts b/build-conventions/build.gradle.kts index 2086450d..778329af 100644 --- a/build-conventions/build.gradle.kts +++ b/build-conventions/build.gradle.kts @@ -39,8 +39,9 @@ dependencyLocking { dependencies { val rootProperties = getRootProperties() - implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${rootProperties.getProperty("KOTLIN_VERSION")}") implementation("com.android.tools.build:gradle:${rootProperties.getProperty("ANDROID_GRADLE_PLUGIN_VERSION")}") + implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:${rootProperties.getProperty("DETEKT_VERSION")}") + implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${rootProperties.getProperty("KOTLIN_VERSION")}") implementation("wtf.emulator:gradle-plugin:${rootProperties.getProperty("EMULATOR_WTF_GRADLE_PLUGIN_VERSION")}") } diff --git a/build-conventions/gradle.lockfile b/build-conventions/gradle.lockfile index ad043b2d..2158aeff 100644 --- a/build-conventions/gradle.lockfile +++ b/build-conventions/gradle.lockfile @@ -66,8 +66,9 @@ com.sun.istack:istack-commons-runtime:3.0.8=runtimeClasspath com.sun.xml.fastinfoset:FastInfoset:1.2.16=runtimeClasspath com.vdurmont:semver4j:3.1.0=runtimeClasspath commons-codec:commons-codec:1.11=runtimeClasspath -commons-io:commons-io:2.4=runtimeClasspath +commons-io:commons-io:2.12.0=runtimeClasspath commons-logging:commons-logging:1.2=runtimeClasspath +io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.0=compileClasspath,runtimeClasspath io.grpc:grpc-api:1.39.0=runtimeClasspath io.grpc:grpc-context:1.39.0=runtimeClasspath io.grpc:grpc-core:1.39.0=runtimeClasspath @@ -151,7 +152,7 @@ org.jetbrains.kotlin:kotlin-util-io:1.8.21=compileClasspath,runtimeClasspath org.jetbrains.kotlin:kotlin-util-klib:1.8.21=runtimeClasspath org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.5.0=runtimeClasspath org.jetbrains:annotations:13.0=compileClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,runtimeClasspath -org.json:json:20180813=runtimeClasspath +org.json:json:20230227=runtimeClasspath org.jvnet.staxex:stax-ex:1.8.1=runtimeClasspath org.ow2.asm:asm-analysis:9.2=runtimeClasspath org.ow2.asm:asm-commons:9.2=runtimeClasspath @@ -160,7 +161,12 @@ org.ow2.asm:asm-util:9.2=runtimeClasspath org.ow2.asm:asm:9.2=compileClasspath,runtimeClasspath org.slf4j:slf4j-api:1.7.30=runtimeClasspath org.tensorflow:tensorflow-lite-metadata:0.1.0-rc2=runtimeClasspath -wtf.emulator:gradle-plugin:0.9.4=compileClasspath,runtimeClasspath +wtf.emulator:gradle-compat-6-1:0.12.2=runtimeClasspath +wtf.emulator:gradle-compat-6-6:0.12.2=runtimeClasspath +wtf.emulator:gradle-compat-7-6:0.12.2=runtimeClasspath +wtf.emulator:gradle-compat-api:0.12.2=runtimeClasspath +wtf.emulator:gradle-compat:0.12.2=runtimeClasspath +wtf.emulator:gradle-plugin:0.12.2=compileClasspath,runtimeClasspath xerces:xercesImpl:2.12.0=runtimeClasspath xml-apis:xml-apis:1.4.01=runtimeClasspath empty=annotationProcessor,kotlinScriptDefExtensions diff --git a/build-conventions/gradle.properties b/build-conventions/gradle.properties index 229d38a2..69198f6a 100644 --- a/build-conventions/gradle.properties +++ b/build-conventions/gradle.properties @@ -1 +1 @@ -FOOJAY_TOOLCHAIN_RESOLVER_VERSION=0.4.0 \ No newline at end of file +FOOJAY_TOOLCHAIN_RESOLVER_VERSION=0.5.0 \ No newline at end of file diff --git a/build-conventions/src/main/kotlin/zcash-sdk.detekt-conventions.gradle.kts b/build-conventions/src/main/kotlin/zcash-sdk.detekt-conventions.gradle.kts new file mode 100644 index 00000000..d7d340e1 --- /dev/null +++ b/build-conventions/src/main/kotlin/zcash-sdk.detekt-conventions.gradle.kts @@ -0,0 +1,38 @@ +import io.gitlab.arturbosch.detekt.Detekt +import io.gitlab.arturbosch.detekt.DetektCreateBaselineTask + +plugins { + id("io.gitlab.arturbosch.detekt") +} + +dependencies { + detektPlugins("io.nlopez.compose.rules:detekt:${project.property("DETEKT_COMPOSE_RULES_VERSION")}") +} + +tasks { + register("detektAll", Detekt::class) { + parallel = true + setSource(files(projectDir)) + include("**/*.kt") + include("**/*.kts") + exclude("**/resources/**") + exclude("**/build/**") + config.setFrom(files("${rootProject.projectDir}/tools/detekt.yml")) + baseline.set(File("${rootProject.projectDir}/tools/detekt-baseline.xml")) + buildUponDefaultConfig = true + } + + register("detektGenerateBaseline", DetektCreateBaselineTask::class) { + description = "Overrides current baseline." + buildUponDefaultConfig.set(true) + ignoreFailures.set(true) + parallel.set(true) + setSource(files(rootDir)) + config.setFrom(files("${rootProject.projectDir}/tools/detekt.yml")) + baseline.set(file("$rootDir/tools/detekt-baseline.xml")) + include("**/*.kt") + include("**/*.kts") + exclude("**/resources/**") + exclude("**/build/**") + } +} diff --git a/build.gradle.kts b/build.gradle.kts index 5e7055c7..d660a1bc 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -13,26 +13,12 @@ buildscript { plugins { id("com.github.ben-manes.versions") id("com.osacky.fulladle") - id("io.gitlab.arturbosch.detekt") + id("zcash-sdk.detekt-conventions") id("zcash-sdk.ktlint-conventions") id("zcash-sdk.rosetta-conventions") } tasks { - register("detektAll", io.gitlab.arturbosch.detekt.Detekt::class) { - parallel = true - setSource(files(projectDir)) - include("**/*.kt") - include("**/*.kts") - exclude("**/resources/**") - exclude("**/build/**") - exclude("**/commonTest/**") - exclude("**/jvmTest/**") - exclude("**/androidTest/**") - config.setFrom(files("${rootProject.projectDir}/tools/detekt.yml")) - buildUponDefaultConfig = true - } - withType { gradleReleaseChannel = "current" diff --git a/darkside-test-lib/build.gradle.kts b/darkside-test-lib/build.gradle.kts index a561b268..727e49e2 100644 --- a/darkside-test-lib/build.gradle.kts +++ b/darkside-test-lib/build.gradle.kts @@ -2,7 +2,6 @@ plugins { id("com.android.library") id("org.jetbrains.kotlin.android") id("zcash-sdk.android-conventions") - id("kotlin-kapt") } android { diff --git a/gradle.properties b/gradle.properties index 1cd3c141..77313271 100644 --- a/gradle.properties +++ b/gradle.properties @@ -81,16 +81,17 @@ ANDROID_COMPILE_SDK_VERSION=33 ANDROID_NDK_VERSION=22.1.7171670 ANDROID_GRADLE_PLUGIN_VERSION=7.4.0 -DETEKT_VERSION=1.22.0 +DETEKT_VERSION=1.23.0 +DETEKT_COMPOSE_RULES_VERSION=0.1.6 DOKKA_VERSION=1.8.10 -EMULATOR_WTF_GRADLE_PLUGIN_VERSION=0.9.4 -FLANK_VERSION=23.03.2 +EMULATOR_WTF_GRADLE_PLUGIN_VERSION=0.12.2 +FLANK_VERSION=23.04.0 # When changing this, be sure to change build-conventions/gradle.properties#FOOJAY_TOOLCHAIN_RESOLVER_VERSION too -FOOJAY_TOOLCHAIN_RESOLVER_VERSION=0.4.0 +FOOJAY_TOOLCHAIN_RESOLVER_VERSION=0.5.0 FULLADLE_VERSION=0.17.4 GRADLE_VERSIONS_PLUGIN_VERSION=0.46.0 KSP_VERSION=1.8.20-1.0.10 -KTLINT_VERSION=0.49.0 +KTLINT_VERSION=0.49.1 PROTOBUF_GRADLE_PLUGIN_VERSION=0.9.1 RUST_GRADLE_PLUGIN_VERSION=0.9.3 diff --git a/tools/detekt-baseline.xml b/tools/detekt-baseline.xml new file mode 100644 index 00000000..2c083678 --- /dev/null +++ b/tools/detekt-baseline.xml @@ -0,0 +1,52 @@ + + + + + CompositionLocalAllowlist:ScreenTimeout.kt$LocalScreenTimeout + EmptyClassBlock:TestWallet.kt$TestWallet.Companion${ } + EmptyFunctionBlock:ReproduceZ2TFailureTest.kt$ReproduceZ2TFailureTest${ } + EmptyFunctionBlock:SampleCodeTest.kt$SampleCodeTest${ } + EmptyFunctionBlock:TransparentTest.kt$TransparentTest.Companion${ } + ForbiddenComment:BalancePrinterUtil.kt$BalancePrinterUtil$// TODO: clear the dataDb but leave the cacheDb + ForbiddenComment:SampleCodeTest.kt$SampleCodeTest$// TODO: call: Mnemonic::from_phrase(seed_phrase, Language::English).unwrap().entropy() + ForbiddenComment:SampleCodeTest.kt$SampleCodeTest$// TODO: call: bip39::Seed::new(&Mnemonic::from_entropy(&seed_bytes, Language::English).unwrap(), "") + ForbiddenComment:SampleCodeTest.kt$SampleCodeTest$// TODO: let mnemonic = Mnemonic::from_entropy(entropy, Language::English).unwrap(); + ForbiddenComment:SampleCodeTest.kt$SampleCodeTest$// TODO: log(seedPhrase.asRawEntropy().asBip39seed()) + ForbiddenComment:SetupTest.kt$SetupTest.Companion$// // TODO: fix this + ForbiddenComment:TransparentTest.kt$TransparentTest$// TODO: If we need this, change DerivationTool to derive from the UFVK instead of the public key. + InvalidPackageDeclaration:Global.kt$package cash.z.ecc.android.sdk.test + LongMethod:DatabaseCoordinatorTest.kt$DatabaseCoordinatorTest$@Test @SmallTest @OptIn(ExperimentalCoroutinesApi::class) fun data_database_files_move_test() + LongMethod:DatabaseCoordinatorTest.kt$DatabaseCoordinatorTest$@Test @SmallTest @OptIn(ExperimentalCoroutinesApi::class) fun delete_all_legacy_database_files_test() + MayBeConst:TestnetIntegrationTest.kt$TestnetIntegrationTest.Companion$val address = "zs1m30y59wxut4zk9w24d6ujrdnfnl42hpy0ugvhgyhr8s0guszutqhdj05c7j472dndjstulph74m" + MayBeConst:TestnetIntegrationTest.kt$TestnetIntegrationTest.Companion$val toAddress = "zs1vp7kvlqr4n9gpehztr76lcn6skkss9p8keqs3nv8avkdtjrcctrvmk9a7u494kluv756jeee5k0" + MultipleEmitters:HomeView.kt$DebugMenu + UnstableCollections:Transactions.kt$List<TransactionOverview> + UnusedPrivateMember:BalancePrinterUtil.kt$BalancePrinterUtil$private suspend fun deleteDb(dbName: String) + UnusedPrivateMember:DataDbScannerUtil.kt$DataDbScannerUtil$private fun cacheBlocks() + UnusedPrivateMember:DataDbScannerUtil.kt$DataDbScannerUtil$private fun deleteDb(dbName: String) + UnusedPrivateProperty:BalancePrinterUtil.kt$BalancePrinterUtil$private val alias = "BalanceUtil" + UnusedPrivateProperty:BalancePrinterUtil.kt$BalancePrinterUtil$private val downloadBatchSize = 9_000 + UnusedPrivateProperty:ChannelFactoryTest.kt$ChannelFactoryTest$private val channelFactory = AndroidChannelFactory(getAppContext()) + UnusedPrivateProperty:DarksideTestCoordinator.kt$DarksideTestCoordinator.Companion$// Block URLS private const val beforeReorg = "https://raw.githubusercontent.com/zcash-hackworks/darksidewalletd-test-data/master/basic-reorg/before-reorg.txt" + UnusedPrivateProperty:DarksideTestCoordinator.kt$DarksideTestCoordinator.Companion$private const val largeReorg = "https://raw.githubusercontent.com/zcash-hackworks/darksidewalletd-test-data/master/basic-reorg/after-large-reorg.txt" + UnusedPrivateProperty:DarksideTestCoordinator.kt$DarksideTestCoordinator.Companion$private const val smallReorg = "https://raw.githubusercontent.com/zcash-hackworks/darksidewalletd-test-data/master/basic-reorg/after-small-reorg.txt" + UnusedPrivateProperty:DataDbScannerUtil.kt$DataDbScannerUtil$private val alias = "ScannerUtil" + UnusedPrivateProperty:DataDbScannerUtil.kt$DataDbScannerUtil$private val host = "lightd-main.zecwallet.co" + UnusedPrivateProperty:DataDbScannerUtil.kt$DataDbScannerUtil$private val port = 443 + UnusedPrivateProperty:FlowExtTest.kt$FlowExtTest$i + UnusedPrivateProperty:InboundTxTests.kt$InboundTxTests.Companion$private const val lastBlockHash = "2fc7b4682f5ba6ba6f86e170b40f0aa9302e1d3becb2a6ee0db611ff87835e4a" + UnusedPrivateProperty:InboundTxTests.kt$InboundTxTests.Companion$private const val txIndexReorg = "https://raw.githubusercontent.com/zcash-hackworks/darksidewalletd-test-data/master/tx-index-reorg/t1.txt" + UnusedPrivateProperty:InboundTxTests.kt$InboundTxTests.Companion$private val txRecv = arrayOf( "https://raw.githubusercontent.com/zcash-hackworks/darksidewalletd-test-data/master/transactions/recv/8f064d23c66dc36e32445e5f3b50e0f32ac3ddb78cff21fb521eb6c19c07c99a.txt", "https://raw.githubusercontent.com/zcash-hackworks/darksidewalletd-test-data/master/transactions/recv/15a677b6770c5505fb47439361d3d3a7c21238ee1a6874fdedad18ae96850590.txt", "https://raw.githubusercontent.com/zcash-hackworks/darksidewalletd-test-data/master/transactions/recv/d2e7be14bbb308f9d4d68de424d622cbf774226d01cd63cc6f155fafd5cd212c.txt", "https://raw.githubusercontent.com/zcash-hackworks/darksidewalletd-test-data/master/transactions/recv/e6566be3a4f9a80035dab8e1d97e40832a639e3ea938fb7972ea2f8482ff51ce.txt", "https://raw.githubusercontent.com/zcash-hackworks/darksidewalletd-test-data/master/transactions/recv/0821a89be7f2fc1311792c3fa1dd2171a8cdfb2effd98590cbd5ebcdcfcf491f.txt", "https://raw.githubusercontent.com/zcash-hackworks/darksidewalletd-test-data/master/transactions/recv/e9527891b5d43d1ac72f2c0a3ac18a33dc5a0529aec04fa600616ed35f8123f8.txt", "https://raw.githubusercontent.com/zcash-hackworks/darksidewalletd-test-data/master/transactions/recv/4dcc95dd0a2f1f51bd64bb9f729b423c6de1690664a1b6614c75925e781662f7.txt", "https://raw.githubusercontent.com/zcash-hackworks/darksidewalletd-test-data/master/transactions/recv/75f2cdd2ff6a94535326abb5d9e663d53cbfa5f31ebb24b4d7e420e9440d41a2.txt", "https://raw.githubusercontent.com/zcash-hackworks/darksidewalletd-test-data/master/transactions/recv/7690c8ec740c1be3c50e2aedae8bf907ac81141ae8b6a134c1811706c73f49a6.txt", "https://raw.githubusercontent.com/zcash-hackworks/darksidewalletd-test-data/master/transactions/recv/71935e29127a7de0b96081f4c8a42a9c11584d83adedfaab414362a6f3d965cf.txt" ) + UnusedPrivateProperty:InboundTxTests.kt$InboundTxTests.Companion$private val txSend = arrayOf( "https://raw.githubusercontent.com/zcash-hackworks/darksidewalletd-test-data/master/transactions/t-shielded-spend.txt", "https://raw.githubusercontent.com/zcash-hackworks/darksidewalletd-test-data/master/transactions/sent/c9e35e6ff444b071d63bf9bab6480409d6361760445c8a28d24179adb35c2495.txt", "https://raw.githubusercontent.com/zcash-hackworks/darksidewalletd-test-data/master/transactions/sent/72a29d7db511025da969418880b749f7fc0fc910cdb06f52193b5fa5c0401d9d.txt", "https://raw.githubusercontent.com/zcash-hackworks/darksidewalletd-test-data/master/transactions/sent/ff6ea36765dc29793775c7aa71de19fca039c5b5b873a0497866e9c4bc48af01.txt", "https://raw.githubusercontent.com/zcash-hackworks/darksidewalletd-test-data/master/transactions/sent/34e507cab780546f980176f3ff2695cd404917508c7e5ee18cc1d2ff3858cb08.txt", "https://raw.githubusercontent.com/zcash-hackworks/darksidewalletd-test-data/master/transactions/sent/6edf869063eccff3345676b0fed9f1aa6988fb2524e3d9ca7420a13cfadcd76c.txt", "https://raw.githubusercontent.com/zcash-hackworks/darksidewalletd-test-data/master/transactions/sent/de97394ae220c28a33ba78b944e82dabec8cb404a4407650b134b3d5950358c0.txt", "https://raw.githubusercontent.com/zcash-hackworks/darksidewalletd-test-data/master/transactions/sent/4eaa902279f8380914baf5bcc470d8b7c11d84fda809f67f517a7cb48912b87b.txt", "https://raw.githubusercontent.com/zcash-hackworks/darksidewalletd-test-data/master/transactions/sent/73c5edf8ffba774d99155121ccf07e67fbcf14284458f7e732751fea60d3bcbc.txt" ) + UnusedPrivateProperty:LightWalletClientImplTest.kt$LightWalletClientImplTest$private val channelFactory = AndroidChannelFactory(getAppContext()) + UnusedPrivateProperty:SetupTest.kt$SetupTest.Companion$private const val blocksUrl = "https://raw.githubusercontent.com/zcash-hackworks/darksidewalletd-test-data/master/basic-reorg/before-reorg.txt" + UnusedPrivateProperty:SetupTest.kt$SetupTest.Companion$private const val firstBlock = 663150 + UnusedPrivateProperty:SetupTest.kt$SetupTest.Companion$private const val lastBlock = 663200 + UnusedPrivateProperty:SetupTest.kt$SetupTest.Companion$private const val lastBlockHash = "2fc7b4682f5ba6ba6f86e170b40f0aa9302e1d3becb2a6ee0db611ff87835e4a" + UnusedPrivateProperty:TestnetIntegrationTest.kt$TestnetIntegrationTest.Companion$private const val seedPhrase = "still champion voice habit trend flight survey between bitter process artefact blind carbon truly provide dizzy crush flush breeze blouse charge solid fish spread" + UnusedPrivateProperty:TestnetIntegrationTest.kt$TestnetIntegrationTest.Companion$private const val targetHeight = 663250 + VariableNaming:FakeRustBackendFixture.kt$FakeRustBackendFixture$private val DEFAULT_NETWORK = ZcashNetwork.Testnet + VariableNaming:ShieldFundsSample.kt$ShieldFundsSample$val SEED_PHRASE = "still champion voice habit trend flight survey between bitter process artefact blind carbon truly provide dizzy crush flush breeze blouse charge solid fish spread" // \"//\"deputy visa gentle among clean scout farm drive comfort patch skin salt ranch cool ramp warrior drink narrow normal lunch behind salt deal person"//"deputy visa gentle among clean scout farm drive comfort patch skin salt ranch cool ramp warrior drink narrow normal lunch behind salt deal person" + VariableNaming:TransparentRestoreSample.kt$TransparentRestoreSample$val TX_VALUE = Zatoshi(ZcashSdk.MINERS_FEE.value / 2) + + diff --git a/tools/detekt.yml b/tools/detekt.yml index b8afc95c..10ec435d 100644 --- a/tools/detekt.yml +++ b/tools/detekt.yml @@ -1,725 +1,33 @@ -build: - maxIssues: 0 - excludeCorrectable: false - weights: - # complexity: 2 - # LongParameterList: 1 - # style: 1 - # comments: 1 - -config: - validation: true - warningsAsErrors: false - checkExhaustiveness: false - # when writing own rules with new properties, exclude the property path e.g.: 'my_rule_set,.*>.*>[my_property]' - excludes: '' - -processors: - active: true - exclude: - - 'DetektProgressListener' - # - 'KtFileCountProcessor' - # - 'PackageCountProcessor' - # - 'ClassCountProcessor' - # - 'FunctionCountProcessor' - # - 'PropertyCountProcessor' - # - 'ProjectComplexityProcessor' - # - 'ProjectCognitiveComplexityProcessor' - # - 'ProjectLLOCProcessor' - # - 'ProjectCLOCProcessor' - # - 'ProjectLOCProcessor' - # - 'ProjectSLOCProcessor' - # - 'LicenseHeaderLoaderExtension' - -console-reports: - active: true - exclude: - - 'ProjectStatisticsReport' - - 'ComplexityReport' - - 'NotificationReport' - - 'FindingsReport' - - 'FileBasedFindingsReport' - # - 'LiteFindingsReport' - -output-reports: - active: true - exclude: - # - 'TxtOutputReport' - # - 'XmlOutputReport' - # - 'HtmlOutputReport' - # - 'MdOutputReport' - -comments: - active: true - AbsentOrWrongFileLicense: - active: false - licenseTemplateFile: 'license.template' - licenseTemplateIsRegex: false - CommentOverPrivateFunction: - active: false - CommentOverPrivateProperty: - active: false - DeprecatedBlockTag: - active: false - EndOfSentenceFormat: - active: false - endOfSentenceFormat: '([.?!][ \t\n\r\f<])|([.?!:]$)' - KDocReferencesNonPublicProperty: - active: false - excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] - OutdatedDocumentation: - active: false - matchTypeParameters: true - matchDeclarationsOrder: true - allowParamOnConstructorProperties: false - UndocumentedPublicClass: - active: false - excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] - searchInNestedClass: true - searchInInnerClass: true - searchInInnerObject: true - searchInInnerInterface: true - searchInProtectedClass: false - UndocumentedPublicFunction: - active: false - excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] - searchProtectedFunction: false - UndocumentedPublicProperty: - active: false - excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] - searchProtectedProperty: false - -complexity: - active: true - CognitiveComplexMethod: - active: false - threshold: 15 - ComplexCondition: - active: true - threshold: 4 - ComplexInterface: - active: false - threshold: 10 - includeStaticDeclarations: false - includePrivateDeclarations: false - ignoreOverloaded: false - CyclomaticComplexMethod: - active: true - threshold: 15 - ignoreSingleWhenExpression: false - ignoreSimpleWhenEntries: false - ignoreNestingFunctions: false - nestingFunctions: - - 'also' - - 'apply' - - 'forEach' - - 'isNotNull' - - 'ifNull' - - 'let' - - 'run' - - 'use' - - 'with' - LabeledExpression: - active: false - ignoredLabels: [] - LargeClass: - active: true - threshold: 600 - LongMethod: - active: true - threshold: 60 - LongParameterList: - active: true - functionThreshold: 6 - constructorThreshold: 7 - ignoreDefaultParameters: false - ignoreDataClasses: true - ignoreAnnotatedParameter: [] - MethodOverloading: - active: false - threshold: 6 - NamedArguments: - active: false - threshold: 3 - ignoreArgumentsMatchingNames: false - NestedBlockDepth: - active: true - threshold: 4 - NestedScopeFunctions: - active: false - threshold: 1 - functions: - - 'kotlin.apply' - - 'kotlin.run' - - 'kotlin.with' - - 'kotlin.let' - - 'kotlin.also' - ReplaceSafeCallChainWithRun: - active: false - StringLiteralDuplication: - active: false - excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] - threshold: 3 - ignoreAnnotation: true - excludeStringsWithLessThan5Characters: true - ignoreStringsRegex: '$^' - TooManyFunctions: - active: true - excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] - thresholdInFiles: 11 - thresholdInClasses: 11 - thresholdInInterfaces: 11 - thresholdInObjects: 11 - thresholdInEnums: 11 - ignoreDeprecated: false - ignorePrivate: false - ignoreOverridden: false - -coroutines: - active: true - GlobalCoroutineUsage: - active: false - InjectDispatcher: - active: true - dispatcherNames: - - 'IO' - - 'Default' - - 'Unconfined' - RedundantSuspendModifier: - active: true - SleepInsteadOfDelay: - active: true - SuspendFunWithCoroutineScopeReceiver: - active: false - SuspendFunWithFlowReturnType: - active: true - -empty-blocks: - active: true - EmptyCatchBlock: - active: true - allowedExceptionNameRegex: '_|(ignore|expected).*' - EmptyClassBlock: - active: true - EmptyDefaultConstructor: - active: true - EmptyDoWhileBlock: - active: true - EmptyElseBlock: - active: true - EmptyFinallyBlock: - active: true - EmptyForBlock: - active: true - EmptyFunctionBlock: - active: true - ignoreOverridden: false - EmptyIfBlock: - active: true - EmptyInitBlock: - active: true - EmptyKtFile: - active: true - EmptySecondaryConstructor: - active: true - EmptyTryBlock: - active: true - EmptyWhenBlock: - active: true - EmptyWhileBlock: - active: true - -exceptions: - active: true - ExceptionRaisedInUnexpectedLocation: - active: true - methodNames: - - 'equals' - - 'finalize' - - 'hashCode' - - 'toString' - InstanceOfCheckForException: - active: true - excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] - NotImplementedDeclaration: - active: false - ObjectExtendsThrowable: - active: false - PrintStackTrace: - active: true - RethrowCaughtException: - active: true - ReturnFromFinally: - active: true - ignoreLabeled: false - SwallowedException: - active: true - ignoredExceptionTypes: - - 'InterruptedException' - - 'MalformedURLException' - - 'NumberFormatException' - - 'ParseException' - allowedExceptionNameRegex: '_|(ignore|expected).*' - ThrowingExceptionFromFinally: - active: true - ThrowingExceptionInMain: - active: false - ThrowingExceptionsWithoutMessageOrCause: - active: true - excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] - exceptions: - - 'ArrayIndexOutOfBoundsException' - - 'Exception' - - 'IllegalArgumentException' - - 'IllegalMonitorStateException' - - 'IllegalStateException' - - 'IndexOutOfBoundsException' - - 'NullPointerException' - - 'RuntimeException' - - 'Throwable' - ThrowingNewInstanceOfSameException: - active: true - TooGenericExceptionCaught: - active: true - excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] - exceptionNames: - - 'ArrayIndexOutOfBoundsException' - - 'Error' - - 'Exception' - - 'IllegalMonitorStateException' - - 'IndexOutOfBoundsException' - - 'NullPointerException' - - 'RuntimeException' - - 'Throwable' - allowedExceptionNameRegex: '_|(ignore|expected).*' - TooGenericExceptionThrown: - active: true - exceptionNames: - - 'Error' - - 'Exception' - - 'RuntimeException' - - 'Throwable' - naming: active: true - BooleanPropertyNaming: - active: false - allowedPattern: '^(is|has|are)' - ignoreOverridden: true - ClassNaming: - active: true - classPattern: '[A-Z][a-zA-Z0-9]*' - ConstructorParameterNaming: - active: true - parameterPattern: '[a-z][A-Za-z0-9]*' - privateParameterPattern: '[a-z][A-Za-z0-9]*' - excludeClassPattern: '$^' - ignoreOverridden: true - EnumNaming: - active: true - enumEntryPattern: '[A-Z][_a-zA-Z0-9]*' - ForbiddenClassName: - active: false - forbiddenName: [] - FunctionMaxLength: - active: false - maximumFunctionNameLength: 30 - FunctionMinLength: - active: false - minimumFunctionNameLength: 3 FunctionNaming: active: true excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] functionPattern: '[a-z][a-zA-Z0-9]*' excludeClassPattern: '$^' - ignoreOverridden: true ignoreAnnotated: - 'Composable' - FunctionParameterNaming: - active: true - parameterPattern: '[a-z][A-Za-z0-9]*' - excludeClassPattern: '$^' - ignoreOverridden: true - InvalidPackageDeclaration: - active: true - rootPackage: '' - requireRootInDeclaration: false - LambdaParameterNaming: - active: false - parameterPattern: '[a-z][A-Za-z0-9]*|_' - MatchingDeclarationName: - active: true - mustBeFirst: true - MemberNameEqualsClassName: - active: true - ignoreOverridden: true - NoNameShadowing: - active: true - NonBooleanPropertyPrefixedWithIs: - active: false - ObjectPropertyNaming: - active: true - constantPattern: '[A-Za-z][_A-Za-z0-9]*' - propertyPattern: '[A-Za-z][_A-Za-z0-9]*' - privatePropertyPattern: '(_)?[A-Za-z][_A-Za-z0-9]*' - PackageNaming: - active: true - packagePattern: '[a-z]+(\.[a-z][A-Za-z0-9]*)*' - TopLevelPropertyNaming: - active: true - constantPattern: '[A-Z][_A-Z0-9]*' - propertyPattern: '[A-Za-z][_A-Za-z0-9]*' - privatePropertyPattern: '_?[A-Za-z][_A-Za-z0-9]*' - VariableMaxLength: - active: false - maximumVariableNameLength: 64 - VariableMinLength: - active: false - minimumVariableNameLength: 1 - VariableNaming: - active: true - variablePattern: '[a-z][A-Za-z0-9]*' - privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*' - excludeClassPattern: '$^' - ignoreOverridden: true - -performance: - active: true - ArrayPrimitive: - active: true - CouldBeSequence: - active: false - threshold: 3 - ForEachOnRange: - active: true - excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] - SpreadOperator: - active: true - excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] - UnnecessaryPartOfBinaryExpression: - active: false - UnnecessaryTemporaryInstantiation: - active: true - -potential-bugs: - active: true - AvoidReferentialEquality: - active: true - forbiddenTypePatterns: - - 'kotlin.String' - CastToNullableType: - active: false - Deprecation: - active: false - DontDowncastCollectionTypes: - active: false - DoubleMutabilityForCollection: - active: true - mutableTypes: - - 'kotlin.collections.MutableList' - - 'kotlin.collections.MutableMap' - - 'kotlin.collections.MutableSet' - - 'java.util.ArrayList' - - 'java.util.LinkedHashSet' - - 'java.util.HashSet' - - 'java.util.LinkedHashMap' - - 'java.util.HashMap' - ElseCaseInsteadOfExhaustiveWhen: - active: false - EqualsAlwaysReturnsTrueOrFalse: - active: true - EqualsWithHashCodeExist: - active: true - ExitOutsideMain: - active: false - ExplicitGarbageCollectionCall: - active: true - HasPlatformType: - active: true - IgnoredReturnValue: - active: true - restrictToConfig: true - returnValueAnnotations: - - '*.CheckResult' - - '*.CheckReturnValue' - ignoreReturnValueAnnotations: - - '*.CanIgnoreReturnValue' - returnValueTypes: - - 'kotlin.sequences.Sequence' - - 'kotlinx.coroutines.flow.*Flow' - - 'java.util.stream.*Stream' - ignoreFunctionCall: [] - ImplicitDefaultLocale: - active: true - ImplicitUnitReturnType: - active: false - allowExplicitReturnType: true - InvalidRange: - active: true - IteratorHasNextCallsNextMethod: - active: true - IteratorNotThrowingNoSuchElementException: - active: true - LateinitUsage: - active: false - excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] - ignoreOnClassesPattern: '' - MapGetWithNotNullAssertionOperator: - active: true - MissingPackageDeclaration: - active: false - excludes: ['**/*.kts'] - NullCheckOnMutableProperty: - active: false - NullableToStringCall: - active: false - UnconditionalJumpStatementInLoop: - active: false - UnnecessaryNotNullCheck: - active: false - UnnecessaryNotNullOperator: - active: true - UnnecessarySafeCall: - active: true - UnreachableCatchBlock: - active: true - UnreachableCode: - active: true - UnsafeCallOnNullableType: - active: true - excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] - UnsafeCast: - active: true - UnusedUnaryOperator: - active: true - UselessPostfixExpression: - active: true - WrongEqualsTypeParameter: - active: true style: active: true - AlsoCouldBeApply: - active: false - CanBeNonNullable: - active: false - CascadingCallWrapping: - active: false - includeElvis: true - ClassOrdering: - active: false - CollapsibleIfStatements: - active: false - DataClassContainsFunctions: - active: false - conversionFunctionPrefix: - - 'to' - DataClassShouldBeImmutable: - active: false - DestructuringDeclarationWithTooManyEntries: - active: true - maxDestructuringEntries: 3 - EqualsNullCall: - active: true - EqualsOnSignatureLine: - active: false - ExplicitCollectionElementAccessMethod: - active: false - ExplicitItLambdaParameter: - active: true - ExpressionBodySyntax: - active: false - includeLineWrapping: false ForbiddenComment: active: true - values: - - 'FIXME:' - - 'STOPSHIP:' - - 'TODO:' - allowedPatterns: '\[[^\]]\d+\]' - customMessage: '' - ForbiddenImport: - active: false - imports: [] - forbiddenPatterns: '' - ForbiddenMethodCall: - active: false - methods: - - reason: 'print does not allow you to configure the output stream. Use a logger instead.' - value: 'kotlin.io.print' - - reason: 'println does not allow you to configure the output stream. Use a logger instead.' - value: 'kotlin.io.println' - ForbiddenSuppress: - active: false - rules: [] - ForbiddenVoid: - active: true - ignoreOverridden: false - ignoreUsageInGenerics: false - FunctionOnlyReturningConstant: - active: true - ignoreOverridableFunction: true - ignoreActualFunction: true - excludedFunctions: [] - LoopWithTooManyJumpStatements: - active: true - maxJumpCount: 1 - MagicNumber: - active: true - excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**', '**/*.kts'] - ignoreNumbers: - - '-1' - - '0' - - '1' - - '2' - ignoreHashCodeFunction: true - ignorePropertyDeclaration: false - ignoreLocalVariableDeclaration: false - ignoreConstantDeclaration: true - ignoreCompanionObjectPropertyDeclaration: true - ignoreAnnotation: false - ignoreNamedArgument: true - ignoreEnums: false - ignoreRanges: false - ignoreExtensionFunctions: true - MandatoryBracesIfStatements: - active: false - MandatoryBracesLoops: - active: false - MaxChainedCallsOnSameLine: - active: false - maxChainedCalls: 5 + comments: + - reason: 'Forbidden FIXME todo marker in comment, please fix the problem.' + value: 'FIXME:' + - reason: 'Forbidden TODO todo marker in comment, please fix the problem or add the issue number (e.g. TODO [#123]).' + value: 'TODO:(?! \[[^\]]\d+\])' MaxLineLength: - active: true - maxLineLength: 120 - excludePackageStatements: true - excludeImportStatements: true - excludeCommentStatements: false - excludeRawStrings: true - MayBeConst: - active: true - ModifierOrder: - active: true - MultilineLambdaItParameter: active: false - MultilineRawStringIndentation: - active: false - indentSize: 4 - NestedClassesVisibility: - active: true NewLineAtEndOfFile: active: false - NoTabs: - active: false - NullableBooleanCheck: - active: false - ObjectLiteralToLambda: - active: true - OptionalAbstractKeyword: - active: true - OptionalUnit: - active: false - OptionalWhenBraces: - active: false - PreferToOverPairSyntax: - active: false - ProtectedMemberInFinalClass: - active: true - RedundantExplicitType: - active: false - RedundantHigherOrderMapUsage: - active: true - RedundantVisibilityModifierRule: - active: false - ReturnCount: - active: true - max: 2 - excludedFunctions: - - 'equals' - excludeLabeled: false - excludeReturnFromLambda: true - excludeGuardClauses: false - SafeCast: - active: true - SerialVersionUIDInSerializableClass: - active: true - SpacingBetweenPackageAndImports: - active: false - ThrowsCount: - active: true - max: 2 - excludeGuardClauses: false - TrailingWhitespace: - active: false - TrimMultilineRawString: - active: false - UnderscoresInNumericLiterals: - active: false - acceptableLength: 4 - allowNonStandardGrouping: false - UnnecessaryAbstractClass: - active: true - UnnecessaryAnnotationUseSiteTarget: - active: false - UnnecessaryApply: - active: true - UnnecessaryBackticks: - active: false - UnnecessaryFilter: - active: true - UnnecessaryInheritance: - active: true - UnnecessaryInnerClass: - active: false - UnnecessaryLet: - active: false - UnnecessaryParentheses: - active: false - allowForUnclearPrecedence: false - UntilInsteadOfRangeTo: - active: false - UnusedImports: - active: false - UnusedPrivateClass: - active: true UnusedPrivateMember: active: true allowedNames: '(_|ignored|expected|serialVersionUID)' - UseAnyOrNoneInsteadOfFind: - active: true - UseArrayLiteralsInAnnotations: - active: true - UseCheckNotNull: - active: true - UseCheckOrError: - active: true - UseDataClass: - active: false - allowVars: false - UseEmptyCounterpart: - active: false - UseIfEmptyOrIfBlank: - active: false - UseIfInsteadOfWhen: - active: false - UseIsNullOrEmpty: - active: true - UseOrEmpty: - active: true - UseRequire: - active: true - UseRequireNotNull: - active: true - UseSumOfInsteadOfFlatMapSize: - active: false - UselessCallOnNotNull: - active: true - UtilityClassWithPublicConstructor: - active: true - VarCouldBeVal: - active: true - ignoreLateinitVar: false + excludes: [ '**/*.kts' ] WildcardImport: - active: true - excludeImports: - - 'java.util.*' + active: false + +Compose: + ModifierMissing: + active: false