diff --git a/build.gradle b/build.gradle index ee4b84e..2719859 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,6 @@ +import io.gitlab.arturbosch.detekt.Detekt +import io.gitlab.arturbosch.detekt.DetektCreateBaselineTask + // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { @@ -19,7 +22,7 @@ plugins { // Others experiencing it: https://github.com/gradle/gradle/issues/3593 // Mozilla decided to live with the duplication: https://github.com/mozilla-mobile/focus-android/issues/1886 // Possible solution that requires changing to Gradle Kotlin DSL: https://github.com/gradle/gradle/issues/1697 - id "io.gitlab.arturbosch.detekt" version "1.16.0" + id "io.gitlab.arturbosch.detekt" version "1.23.1" } allprojects { @@ -38,29 +41,39 @@ allprojects { } subprojects { - def detektVersion = "1.16.0" - apply plugin: 'io.gitlab.arturbosch.detekt' detekt { - toolVersion = detektVersion + buildUponDefaultConfig = true // preconfigure defaults + allRules = false // activate all available (even unstable) rules. config = files("$rootProject.projectDir/detekt-config.yml") baseline = file("$rootProject.projectDir/detekt-baseline.xml") - - reports { - html { - enabled = true - destination = file("$project.buildDir/reports/detekt.html") - } - } } // enable detekt formatting rules dependencies { - detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:$detektVersion" + detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:1.23.1" + detektPlugins "io.gitlab.arturbosch.detekt:detekt-rules-style:1.23.1" + } + tasks.withType(Detekt).configureEach { + jvmTarget = "1.8" + reports { + html.required = true + } + } + tasks.withType(DetektCreateBaselineTask).configureEach { + jvmTarget = "1.8" } } task clean(type: Delete) { delete rootProject.buildDir } + + +//buildCache { +// local { +// directory = new File(rootDir, '.gradle/build-cache') +// removeUnusedEntriesAfterDays = 30 +// } +//} diff --git a/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/database/.DS_Store b/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/database/.DS_Store new file mode 100644 index 0000000..001d2ab Binary files /dev/null and b/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/database/.DS_Store differ diff --git a/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/database/CardDao.kt b/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/database/CardDao.kt index d6594a2..7572947 100644 --- a/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/database/CardDao.kt +++ b/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/database/CardDao.kt @@ -11,25 +11,27 @@ import io.reactivex.Single @Dao interface CardDao { @Transaction - @Query(""" - SELECT - Card.*, - CASE Card.id WHEN CAST(:ftsTerm AS INTEGER) then 1 ELSE 0 END AS _rank - FROM Card - LEFT OUTER JOIN ( - SELECT Rule.cardPk as cardPk from Rule - JOIN RuleFts on RuleFts.docid = Rule.id - WHERE RuleFts MATCH :ftsTerm - ) AS rule_fts ON rule_fts.cardPk = Card.pk - LEFT OUTER JOIN ( - SELECT docid as cardPk FROM CardFts WHERE CardFts MATCH :ftsTerm - ) AS card_fts ON card_fts.cardPk = Card.pk - WHERE - Card.deck in (:decks) - AND COALESCE(rule_fts.cardPk, card_fts.cardPk) IS NOT NULL - GROUP BY Card.pk - ORDER BY _rank DESC, Card.pk ASC - """) + @Query( + """ + SELECT + Card.*, + CASE Card.id WHEN CAST(:ftsTerm AS INTEGER) then 1 ELSE 0 END AS _rank + FROM Card + LEFT OUTER JOIN ( + SELECT Rule.cardPk as cardPk from Rule + JOIN RuleFts on RuleFts.docid = Rule.id + WHERE RuleFts MATCH :ftsTerm + ) AS rule_fts ON rule_fts.cardPk = Card.pk + LEFT OUTER JOIN ( + SELECT docid as cardPk FROM CardFts WHERE CardFts MATCH :ftsTerm + ) AS card_fts ON card_fts.cardPk = Card.pk + WHERE + Card.deck in (:decks) + AND COALESCE(rule_fts.cardPk, card_fts.cardPk) IS NOT NULL + GROUP BY Card.pk + ORDER BY _rank DESC, Card.pk ASC + """ + ) fun getCardsByDeckAndQuery( decks: Array, ftsTerm: String diff --git a/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/database/CardStore.kt b/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/database/CardStore.kt index 89937e2..e3f3fe4 100644 --- a/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/database/CardStore.kt +++ b/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/database/CardStore.kt @@ -5,6 +5,7 @@ import com.fueledbycaffeine.bunnypedia.database.model.CardWithRules import com.fueledbycaffeine.bunnypedia.database.model.Deck import io.reactivex.Single import timber.log.Timber +import java.util.Locale class CardStore(private val dao: CardDao) { fun getCards(decks: Set, query: String): DataSource.Factory { @@ -12,7 +13,7 @@ class CardStore(private val dao: CardDao) { // String IDs must be matched with the prefix 0s, so build terms including those leading 0s val ftsTerm = if (query.matches("^\\d+$".toRegex()) && query.length < 4) { val terms = (query.length..4).map { size -> - String.format("%0${size}d*", query.toInt()) + String.format(Locale.US, "%0${size}d*", query.toInt()) } terms.joinToString(" OR ") } else { diff --git a/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/database/model/Rank.kt b/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/database/model/Rank.kt index 773fc6a..808f189 100644 --- a/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/database/model/Rank.kt +++ b/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/database/model/Rank.kt @@ -7,26 +7,24 @@ import com.fueledbycaffeine.bunnypedia.database.model.RankType.ENLISTED import com.fueledbycaffeine.bunnypedia.database.model.RankType.OFFICER enum class Rank(val type: RankType, val grade: Int) { - // Enlisted - E1(ENLISTED, 1), // Seaman Recruit - E2(ENLISTED, 2), // Seaman Apprentice - E3(ENLISTED, 3), // Seaman - E4(ENLISTED, 4), // Petty Officer 3rd Class - E5(ENLISTED, 5), // Petty Officer 2nd Class - E6(ENLISTED, 6), // Petty Officer 1st Class - E7(ENLISTED, 7), // Chief Petty Officer - E8(ENLISTED, 8), // Senior Chief Petty Officer - E9(ENLISTED, 9), // Master Chief Petty Officer - // Officer - O1(OFFICER, 1), // Ensign - O2(OFFICER, 2), // Lieutenant JG - O3(OFFICER, 3), // Lieutenant - O4(OFFICER, 4), // Lieutenant Commander - O5(OFFICER, 5), // Commander - O6(OFFICER, 6), // Captain - O7(OFFICER, 7), // Lower Rear Admiral - O8(OFFICER, 8), // Upper Rear Admiral - O9(OFFICER, 9), // Vice Admiral + E1(ENLISTED, 1), // Seaman Recruit + E2(ENLISTED, 2), // Seaman Apprentice + E3(ENLISTED, 3), // Seaman + E4(ENLISTED, 4), // Petty Officer 3rd Class + E5(ENLISTED, 5), // Petty Officer 2nd Class + E6(ENLISTED, 6), // Petty Officer 1st Class + E7(ENLISTED, 7), // Chief Petty Officer + E8(ENLISTED, 8), // Senior Chief Petty Officer + E9(ENLISTED, 9), // Master Chief Petty Officer + O1(OFFICER, 1), // Ensign + O2(OFFICER, 2), // Lieutenant JG + O3(OFFICER, 3), // Lieutenant + O4(OFFICER, 4), // Lieutenant Commander + O5(OFFICER, 5), // Commander + O6(OFFICER, 6), // Captain + O7(OFFICER, 7), // Lower Rear Admiral + O8(OFFICER, 8), // Upper Rear Admiral + O9(OFFICER, 9), // Vice Admiral ; val description: Int @StringRes get() { diff --git a/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/database/model/ZodiacSign.kt b/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/database/model/ZodiacSign.kt index 6c16f90..890fc0a 100644 --- a/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/database/model/ZodiacSign.kt +++ b/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/database/model/ZodiacSign.kt @@ -55,6 +55,7 @@ enum class ZodiacSign(val element: ZodiacElement, val number: Int) { } } + @Suppress("NoMultipleSpaces") val range: Pair get() = when (this) { CAPRICORN -> MonthDay.of(Month.DECEMBER, 22) to MonthDay.of(Month.JANUARY, 20) AQUARIUS -> MonthDay.of(Month.JANUARY, 21) to MonthDay.of(Month.FEBRUARY, 19) diff --git a/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/injection/AppComponent.kt b/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/injection/AppComponent.kt index 868a608..cd4641f 100644 --- a/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/injection/AppComponent.kt +++ b/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/injection/AppComponent.kt @@ -6,12 +6,14 @@ import dagger.android.support.AndroidSupportInjectionModule import javax.inject.Singleton @Singleton -@Component(modules = [ - AndroidSupportInjectionModule::class, - AppModule::class, - ActivityModule::class, - DatabaseModule::class -]) +@Component( + modules = [ + AndroidSupportInjectionModule::class, + AppModule::class, + ActivityModule::class, + DatabaseModule::class + ] +) internal interface AppComponent : AndroidInjector { @Suppress("DEPRECATION") @Component.Builder diff --git a/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/injection/DatabaseModule.kt b/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/injection/DatabaseModule.kt index 381e0b9..14df0e1 100644 --- a/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/injection/DatabaseModule.kt +++ b/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/injection/DatabaseModule.kt @@ -15,16 +15,20 @@ import timber.log.Timber class DatabaseModule { @Provides fun provideDatabase(context: Context): AppDatabase { - return Room.databaseBuilder( + return Room + .databaseBuilder( context, AppDatabase::class.java, DATABASE_NAME ) - .createFromAsset("databases/$DATABASE_NAME", object : RoomDatabase.PrepackagedDatabaseCallback() { - override fun onOpenPrepackagedDatabase(db: SupportSQLiteDatabase) { - Timber.i("Copying packaged db asset: ${db.path}") + .createFromAsset( + "databases/$DATABASE_NAME", + object : RoomDatabase.PrepackagedDatabaseCallback() { + override fun onOpenPrepackagedDatabase(db: SupportSQLiteDatabase) { + Timber.i("Copying packaged db asset: ${db.path}") + } } - }) + ) .build() } diff --git a/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/ui/card/list/CardAdapter.kt b/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/ui/card/list/CardAdapter.kt index 2d0521f..c2c8722 100644 --- a/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/ui/card/list/CardAdapter.kt +++ b/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/ui/card/list/CardAdapter.kt @@ -1,8 +1,8 @@ package com.fueledbycaffeine.bunnypedia.ui.card.list -import androidx.paging.PagedListAdapter import android.view.ViewGroup import androidx.fragment.app.Fragment +import androidx.paging.PagedListAdapter import androidx.recyclerview.widget.DiffUtil import com.fueledbycaffeine.bunnypedia.R import com.fueledbycaffeine.bunnypedia.database.model.CardWithRules diff --git a/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/ui/card/list/CardGridViewHolder.kt b/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/ui/card/list/CardGridViewHolder.kt index c18bc81..2c8f67e 100644 --- a/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/ui/card/list/CardGridViewHolder.kt +++ b/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/ui/card/list/CardGridViewHolder.kt @@ -1,14 +1,16 @@ package com.fueledbycaffeine.bunnypedia.ui.card.list -import androidx.core.content.ContextCompat import android.view.View +import androidx.core.content.ContextCompat import com.bumptech.glide.RequestManager import com.bumptech.glide.request.target.Target import com.fueledbycaffeine.bunnypedia.R import com.fueledbycaffeine.bunnypedia.database.model.CardWithRules import com.fueledbycaffeine.bunnypedia.util.ColorUtil import kotlinx.android.extensions.LayoutContainer -import kotlinx.android.synthetic.main.card_view_grid_item.* +import kotlinx.android.synthetic.main.card_view_grid_item.image +import kotlinx.android.synthetic.main.card_view_grid_item.title +import kotlinx.android.synthetic.main.card_view_grid_item.titleBackground class CardGridViewHolder(override val containerView: View) : CardViewHolder(containerView), LayoutContainer { override fun bind(requestManager: RequestManager, cardAndRules: CardWithRules) { diff --git a/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/ui/card/list/CardListViewHolder.kt b/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/ui/card/list/CardListViewHolder.kt index ac9decc..8ebeced 100644 --- a/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/ui/card/list/CardListViewHolder.kt +++ b/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/ui/card/list/CardListViewHolder.kt @@ -11,6 +11,7 @@ import com.fueledbycaffeine.bunnypedia.ext.android.stripHtmlTags import com.fueledbycaffeine.bunnypedia.util.ColorUtil import kotlinx.android.extensions.LayoutContainer import kotlinx.android.synthetic.main.card_view_list_item.* +import java.util.Locale class CardListViewHolder(override val containerView: View) : CardViewHolder(containerView), LayoutContainer { override fun bind(requestManager: RequestManager, cardAndRules: CardWithRules) { @@ -20,7 +21,7 @@ class CardListViewHolder(override val containerView: View) : CardViewHolder(cont .into(image) val (card, rules) = cardAndRules - cardNumber.text = String.format("#%s", card.id) + cardNumber.text = String.format(Locale.US, "#%s", card.id) title.text = card.title cardText.text = rules.firstOrNull()?.text?.stripHtmlTags() ?: "" diff --git a/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/ui/card/list/CardViewHolder.kt b/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/ui/card/list/CardViewHolder.kt index 805dcf3..9168ddf 100644 --- a/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/ui/card/list/CardViewHolder.kt +++ b/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/ui/card/list/CardViewHolder.kt @@ -1,8 +1,8 @@ package com.fueledbycaffeine.bunnypedia.ui.card.list import android.view.View -import com.bumptech.glide.RequestManager import androidx.recyclerview.widget.RecyclerView +import com.bumptech.glide.RequestManager import com.fueledbycaffeine.bunnypedia.database.model.CardWithRules abstract class CardViewHolder(view: View) : RecyclerView.ViewHolder(view) { diff --git a/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/util/ColorUtil.kt b/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/util/ColorUtil.kt index 37afd48..d823963 100644 --- a/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/util/ColorUtil.kt +++ b/bunnies/src/main/java/com/fueledbycaffeine/bunnypedia/util/ColorUtil.kt @@ -7,18 +7,20 @@ object ColorUtil { fun getLuminance(@ColorInt color: Int): Double { return 1 - ( 0.299 * Color.red(color) + - 0.587 * Color.green(color) + - 0.114 * Color.blue(color) - ) / 255 + 0.587 * Color.green(color) + + 0.114 * Color.blue(color) + ) / 255 } - @ColorInt fun contrastColor(@ColorInt color: Int): Int { + @ColorInt + fun contrastColor(@ColorInt color: Int): Int { val luminance = getLuminance(color) val white = if (luminance < 0.5) 0 else 255 return Color.argb(255, white, white, white) } - @ColorInt fun darkenColor(@ColorInt color: Int, byAmount: Float): Int { + @ColorInt + fun darkenColor(@ColorInt color: Int, byAmount: Float): Int { val hsv = FloatArray(3) Color.colorToHSV(color, hsv) hsv[2] *= (1 - byAmount) diff --git a/detekt-config.yml b/detekt-config.yml index 6ed29ce..61dbcdd 100644 --- a/detekt-config.yml +++ b/detekt-config.yml @@ -1,36 +1,39 @@ 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: "" + excludes: '' processors: active: true exclude: - - "DetektProgressListener" + - 'DetektProgressListener' + # - 'KtFileCountProcessor' + # - 'PackageCountProcessor' + # - 'ClassCountProcessor' # - 'FunctionCountProcessor' # - 'PropertyCountProcessor' - # - 'ClassCountProcessor' - # - 'PackageCountProcessor' - # - 'KtFileCountProcessor' + # - 'ProjectComplexityProcessor' + # - 'ProjectCognitiveComplexityProcessor' + # - 'ProjectLLOCProcessor' + # - 'ProjectCLOCProcessor' + # - 'ProjectLOCProcessor' + # - 'ProjectSLOCProcessor' + # - 'LicenseHeaderLoaderExtension' console-reports: active: true exclude: - - "ProjectStatisticsReport" - - "ComplexityReport" - - "NotificationReport" - # - 'FindingsReport' - - "FileBasedFindingsReport" + - 'ProjectStatisticsReport' + - 'ComplexityReport' + - 'NotificationReport' + - 'FindingsReport' + - 'FileBasedFindingsReport' + # - 'LiteFindingsReport' output-reports: active: true @@ -38,133 +41,60 @@ output-reports: # - 'TxtOutputReport' # - 'XmlOutputReport' # - 'HtmlOutputReport' + # - 'MdOutputReport' + # - 'SarifOutputReport' + +complexity: + active: true + TooManyFunctions: + active: true + thresholdInClasses: 15 comments: active: true - excludes: - [ - "**/test/**", - "**/androidTest/**", - "**/commonTest/**", - "**/jvmTest/**", - "**/jsTest/**", - "**/iosTest/**", - ] AbsentOrWrongFileLicense: active: false - licenseTemplateFile: "license.template" + 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/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**'] + OutdatedDocumentation: + active: false + matchTypeParameters: true + matchDeclarationsOrder: true + allowParamOnConstructorProperties: false UndocumentedPublicClass: active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**'] searchInNestedClass: true searchInInnerClass: true searchInInnerObject: true searchInInnerInterface: true + searchInProtectedClass: false UndocumentedPublicFunction: active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**'] + searchProtectedFunction: false UndocumentedPublicProperty: active: false - -complexity: - active: true - ComplexCondition: - active: true - threshold: 4 - ComplexInterface: - active: false - threshold: 10 - includeStaticDeclarations: false - includePrivateDeclarations: false - ComplexMethod: - active: true - threshold: 15 - ignoreSingleWhenExpression: false - ignoreSimpleWhenEntries: false - ignoreNestingFunctions: false - nestingFunctions: - [run, let, apply, with, also, use, forEach, isNotNull, ifNull] - LabeledExpression: - active: false - ignoredLabels: [] - LargeClass: - active: true - threshold: 600 - LongMethod: - active: true - threshold: 100 - LongParameterList: - active: true - functionThreshold: 10 - constructorThreshold: 10 - ignoreDefaultParameters: false - ignoreDataClasses: true - ignoreAnnotated: [] - MethodOverloading: - active: false - threshold: 6 - NamedArguments: - active: false - threshold: 3 - NestedBlockDepth: - active: true - threshold: 4 - ReplaceSafeCallChainWithRun: - active: false - StringLiteralDuplication: - active: false - excludes: - [ - "**/test/**", - "**/androidTest/**", - "**/commonTest/**", - "**/jvmTest/**", - "**/jsTest/**", - "**/iosTest/**", - ] - threshold: 3 - ignoreAnnotation: true - excludeStringsWithLessThan5Characters: true - ignoreStringsRegex: "$^" - TooManyFunctions: - active: false - excludes: - [ - "**/test/**", - "**/androidTest/**", - "**/commonTest/**", - "**/jvmTest/**", - "**/jsTest/**", - "**/iosTest/**", - ] - thresholdInFiles: 11 - thresholdInClasses: 11 - thresholdInInterfaces: 11 - thresholdInObjects: 11 - thresholdInEnums: 11 - ignoreDeprecated: false - ignorePrivate: true - ignoreOverridden: true - -coroutines: - active: true - GlobalCoroutineUsage: - active: false - RedundantSuspendModifier: - active: false - SuspendFunWithFlowReturnType: - active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**'] + searchProtectedProperty: false empty-blocks: active: true EmptyCatchBlock: active: true - allowedExceptionNameRegex: "_|(ignore|expected).*" + allowedExceptionNameRegex: '_|(ignore|expected).*' EmptyClassBlock: active: true EmptyDefaultConstructor: @@ -184,8 +114,6 @@ empty-blocks: active: true EmptyInitBlock: active: true - EmptyKtFile: - active: true EmptySecondaryConstructor: active: true EmptyTryBlock: @@ -198,466 +126,217 @@ empty-blocks: exceptions: active: true ExceptionRaisedInUnexpectedLocation: - active: false - methodNames: [toString, hashCode, equals, finalize] + active: true + methodNames: + - 'equals' + - 'finalize' + - 'hashCode' + - 'toString' InstanceOfCheckForException: - active: false - excludes: - [ - "**/test/**", - "**/androidTest/**", - "**/commonTest/**", - "**/jvmTest/**", - "**/jsTest/**", - "**/iosTest/**", - ] + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**'] NotImplementedDeclaration: active: false - PrintStackTrace: + ObjectExtendsThrowable: active: false + PrintStackTrace: + active: true RethrowCaughtException: - active: false + active: true ReturnFromFinally: - active: false + active: true ignoreLabeled: false SwallowedException: - active: false + active: true ignoredExceptionTypes: - - InterruptedException - - NumberFormatException - - ParseException - - MalformedURLException - allowedExceptionNameRegex: "_|(ignore|expected).*" + - 'InterruptedException' + - 'MalformedURLException' + - 'NumberFormatException' + - 'ParseException' + allowedExceptionNameRegex: '_|(ignore|expected).*' ThrowingExceptionFromFinally: - active: false + active: true ThrowingExceptionInMain: active: false ThrowingExceptionsWithoutMessageOrCause: - active: false - excludes: - [ - "**/test/**", - "**/androidTest/**", - "**/commonTest/**", - "**/jvmTest/**", - "**/jsTest/**", - "**/iosTest/**", - ] + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**'] exceptions: - - IllegalArgumentException - - IllegalStateException - - IOException + - 'ArrayIndexOutOfBoundsException' + - 'Exception' + - 'IllegalArgumentException' + - 'IllegalMonitorStateException' + - 'IllegalStateException' + - 'IndexOutOfBoundsException' + - 'NullPointerException' + - 'RuntimeException' + - 'Throwable' ThrowingNewInstanceOfSameException: - active: false + active: true TooGenericExceptionCaught: - active: false - excludes: - [ - "**/test/**", - "**/androidTest/**", - "**/commonTest/**", - "**/jvmTest/**", - "**/jsTest/**", - "**/iosTest/**", - ] + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**'] exceptionNames: - - ArrayIndexOutOfBoundsException - - Error - - Exception - - IllegalMonitorStateException - - NullPointerException - - IndexOutOfBoundsException - - RuntimeException - - Throwable - allowedExceptionNameRegex: "_|(ignore|expected).*" + - 'ArrayIndexOutOfBoundsException' + - 'Error' + - 'Exception' + - 'IllegalMonitorStateException' + - 'IndexOutOfBoundsException' + - 'NullPointerException' + - 'RuntimeException' + - 'Throwable' + allowedExceptionNameRegex: '_|(ignore|expected).*' TooGenericExceptionThrown: active: true exceptionNames: - - Error - - Exception - - Throwable - - RuntimeException - -formatting: - active: true - android: false - autoCorrect: true - AnnotationOnSeparateLine: - active: false - autoCorrect: true - AnnotationSpacing: - active: false - autoCorrect: true - ArgumentListWrapping: - active: false - autoCorrect: true - ChainWrapping: - active: true - autoCorrect: true - CommentSpacing: - active: true - autoCorrect: true - EnumEntryNameCase: - active: false - autoCorrect: true - Filename: - active: true - FinalNewline: - active: true - autoCorrect: true - insertFinalNewLine: true - ImportOrdering: - active: false - autoCorrect: true - layout: "idea" - Indentation: - active: false - autoCorrect: true - indentSize: 2 - continuationIndentSize: 2 - MaximumLineLength: - active: true - maxLineLength: 120 - ModifierOrdering: - active: true - autoCorrect: true - MultiLineIfElse: - active: true - autoCorrect: true - NoBlankLineBeforeRbrace: - active: true - autoCorrect: true - NoConsecutiveBlankLines: - active: true - autoCorrect: true - NoEmptyClassBody: - active: true - autoCorrect: true - NoEmptyFirstLineInMethodBlock: - active: false - autoCorrect: true - NoLineBreakAfterElse: - active: true - autoCorrect: true - NoLineBreakBeforeAssignment: - active: true - autoCorrect: true - NoMultipleSpaces: - active: false - autoCorrect: false - NoSemicolons: - active: true - autoCorrect: true - NoTrailingSpaces: - active: true - autoCorrect: true - NoUnitReturn: - active: true - autoCorrect: true - NoUnusedImports: - active: true - autoCorrect: true - NoWildcardImports: - active: false - PackageName: - active: true - autoCorrect: true - ParameterListWrapping: - active: true - autoCorrect: true - indentSize: 2 - SpacingAroundColon: - active: true - autoCorrect: true - SpacingAroundComma: - active: true - autoCorrect: true - SpacingAroundCurly: - active: true - autoCorrect: true - SpacingAroundDot: - active: true - autoCorrect: true - SpacingAroundDoubleColon: - active: false - autoCorrect: true - SpacingAroundKeyword: - active: true - autoCorrect: true - SpacingAroundOperators: - active: true - autoCorrect: true - SpacingAroundParens: - active: true - autoCorrect: true - SpacingAroundRangeOperator: - active: true - autoCorrect: true - SpacingBetweenDeclarationsWithAnnotations: - active: false - autoCorrect: true - SpacingBetweenDeclarationsWithComments: - active: false - autoCorrect: true - StringTemplate: - active: true - autoCorrect: true + - 'Error' + - 'Exception' + - 'RuntimeException' + - 'Throwable' naming: active: true + BooleanPropertyNaming: + active: false + allowedPattern: '^(is|has|are)' ClassNaming: active: true - excludes: - [ - "**/test/**", - "**/androidTest/**", - "**/commonTest/**", - "**/jvmTest/**", - "**/jsTest/**", - "**/iosTest/**", - ] - classPattern: "[A-Z][a-zA-Z0-9]*" + classPattern: '[A-Z][a-zA-Z0-9]*' ConstructorParameterNaming: active: true - excludes: - [ - "**/test/**", - "**/androidTest/**", - "**/commonTest/**", - "**/jvmTest/**", - "**/jsTest/**", - "**/iosTest/**", - ] - parameterPattern: "[a-z][A-Za-z0-9]*" - privateParameterPattern: "[a-z][A-Za-z0-9]*" - excludeClassPattern: "$^" - ignoreOverridden: true + parameterPattern: '[a-z][A-Za-z0-9]*' + privateParameterPattern: '[a-z][A-Za-z0-9]*' + excludeClassPattern: '$^' EnumNaming: active: true - excludes: - [ - "**/test/**", - "**/androidTest/**", - "**/commonTest/**", - "**/jvmTest/**", - "**/jsTest/**", - "**/iosTest/**", - ] - enumEntryPattern: "[A-Z][_a-zA-Z0-9]*" + enumEntryPattern: '[A-Z][_a-zA-Z0-9]*' ForbiddenClassName: active: false - excludes: - [ - "**/test/**", - "**/androidTest/**", - "**/commonTest/**", - "**/jvmTest/**", - "**/jsTest/**", - "**/iosTest/**", - ] forbiddenName: [] - FunctionMaxLength: - active: false - excludes: - [ - "**/test/**", - "**/androidTest/**", - "**/commonTest/**", - "**/jvmTest/**", - "**/jsTest/**", - "**/iosTest/**", - ] - maximumFunctionNameLength: 30 - FunctionMinLength: - active: false - excludes: - [ - "**/test/**", - "**/androidTest/**", - "**/commonTest/**", - "**/jvmTest/**", - "**/jsTest/**", - "**/iosTest/**", - ] - minimumFunctionNameLength: 3 FunctionNaming: active: true - excludes: - [ - "**/test/**", - "**/androidTest/**", - "**/commonTest/**", - "**/jvmTest/**", - "**/jsTest/**", - "**/iosTest/**", - ] - functionPattern: "([a-z][a-zA-Z0-9]*)|(`.*`)" - excludeClassPattern: "$^" - ignoreOverridden: true - ignoreAnnotated: ["Composable"] + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**'] + functionPattern: '[a-z][a-zA-Z0-9]*' + excludeClassPattern: '$^' FunctionParameterNaming: active: true - excludes: - [ - "**/test/**", - "**/androidTest/**", - "**/commonTest/**", - "**/jvmTest/**", - "**/jsTest/**", - "**/iosTest/**", - ] - parameterPattern: "[a-z][A-Za-z0-9]*" - excludeClassPattern: "$^" - ignoreOverridden: true + parameterPattern: '[a-z][A-Za-z0-9]*' + excludeClassPattern: '$^' InvalidPackageDeclaration: + active: true + rootPackage: '' + requireRootInDeclaration: false + LambdaParameterNaming: active: false - rootPackage: "" + parameterPattern: '[a-z][A-Za-z0-9]*|_' MatchingDeclarationName: active: true mustBeFirst: true MemberNameEqualsClassName: active: true ignoreOverridden: true + NoNameShadowing: + active: true NonBooleanPropertyPrefixedWithIs: active: false - excludes: - [ - "**/test/**", - "**/androidTest/**", - "**/commonTest/**", - "**/jvmTest/**", - "**/jsTest/**", - "**/iosTest/**", - ] ObjectPropertyNaming: active: true - excludes: - [ - "**/test/**", - "**/androidTest/**", - "**/commonTest/**", - "**/jvmTest/**", - "**/jsTest/**", - "**/iosTest/**", - ] - constantPattern: "[A-Za-z][_A-Za-z0-9]*" - propertyPattern: "[A-Za-z][_A-Za-z0-9]*" - privatePropertyPattern: "(_)?[A-Za-z][_A-Za-z0-9]*" + 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 - excludes: - [ - "**/test/**", - "**/androidTest/**", - "**/commonTest/**", - "**/jvmTest/**", - "**/jsTest/**", - "**/iosTest/**", - ] - packagePattern: '[a-z]+(\.[a-z][A-Za-z_0-9]*)*' + packagePattern: '[a-z]+(\.[a-z][A-Za-z0-9]*)*' TopLevelPropertyNaming: active: true - excludes: - [ - "**/test/**", - "**/androidTest/**", - "**/commonTest/**", - "**/jvmTest/**", - "**/jsTest/**", - "**/iosTest/**", - ] - constantPattern: "[A-Z][_A-Z0-9]*" - propertyPattern: "[A-Za-z][_A-Za-z0-9]*" - privatePropertyPattern: "_?[A-Za-z][_A-Za-z0-9]*" + 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 - excludes: - [ - "**/test/**", - "**/androidTest/**", - "**/commonTest/**", - "**/jvmTest/**", - "**/jsTest/**", - "**/iosTest/**", - ] maximumVariableNameLength: 64 VariableMinLength: active: false - excludes: - [ - "**/test/**", - "**/androidTest/**", - "**/commonTest/**", - "**/jvmTest/**", - "**/jsTest/**", - "**/iosTest/**", - ] minimumVariableNameLength: 1 VariableNaming: active: true - excludes: - [ - "**/test/**", - "**/androidTest/**", - "**/commonTest/**", - "**/jvmTest/**", - "**/jsTest/**", - "**/iosTest/**", - ] - variablePattern: "[a-z][A-Za-z0-9]*" - privateVariablePattern: "(_)?[a-z][A-Za-z0-9]*" - excludeClassPattern: "$^" - ignoreOverridden: true + variablePattern: '[a-z][A-Za-z0-9]*' + privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*' + excludeClassPattern: '$^' performance: active: true ArrayPrimitive: active: true + CouldBeSequence: + active: false ForEachOnRange: active: true - excludes: - [ - "**/test/**", - "**/androidTest/**", - "**/commonTest/**", - "**/jvmTest/**", - "**/jsTest/**", - "**/iosTest/**", - ] + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**'] SpreadOperator: active: true - excludes: - [ - "**/test/**", - "**/androidTest/**", - "**/commonTest/**", - "**/jvmTest/**", - "**/jsTest/**", - "**/iosTest/**", - ] + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**'] + UnnecessaryPartOfBinaryExpression: + active: false UnnecessaryTemporaryInstantiation: active: true potential-bugs: active: true + AvoidReferentialEquality: + active: true + forbiddenTypePatterns: + - 'kotlin.String' + CastNullableToNonNullableType: + active: false + CastToNullableType: + active: false Deprecation: active: false - DuplicateCaseInWhenExpression: + 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 + ignoredSubjectTypes: [] EqualsAlwaysReturnsTrueOrFalse: active: true EqualsWithHashCodeExist: active: true + ExitOutsideMain: + active: false ExplicitGarbageCollectionCall: active: true HasPlatformType: - active: false + active: true IgnoredReturnValue: - active: false - restrictToAnnotatedMethods: true - returnValueAnnotations: ["*.CheckReturnValue", "*.CheckResult"] + active: true + restrictToConfig: true + returnValueAnnotations: + - 'CheckResult' + - '*.CheckResult' + - 'CheckReturnValue' + - '*.CheckReturnValue' + ignoreReturnValueAnnotations: + - 'CanIgnoreReturnValue' + - '*.CanIgnoreReturnValue' + returnValueTypes: + - 'kotlin.sequences.Sequence' + - 'kotlinx.coroutines.flow.*Flow' + - 'java.util.stream.*Stream' + ignoreFunctionCall: [] ImplicitDefaultLocale: - active: false + active: true ImplicitUnitReturnType: active: false allowExplicitReturnType: true @@ -669,54 +348,84 @@ potential-bugs: active: true LateinitUsage: active: false - excludes: - [ - "**/test/**", - "**/androidTest/**", - "**/commonTest/**", - "**/jvmTest/**", - "**/jsTest/**", - "**/iosTest/**", - ] - excludeAnnotatedProperties: [] - ignoreOnClassesPattern: "" + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**'] + ignoreOnClassesPattern: '' MapGetWithNotNullAssertionOperator: - active: false - MissingWhenCase: active: true - allowElseExpression: true + MissingPackageDeclaration: + active: false + excludes: ['**/*.kts'] + NullCheckOnMutableProperty: + active: false NullableToStringCall: active: false - RedundantElseInWhen: - active: true + PropertyUsedBeforeDeclaration: + active: false UnconditionalJumpStatementInLoop: active: false - UnnecessaryNotNullOperator: + UnnecessaryNotNullCheck: active: false + UnnecessaryNotNullOperator: + active: true UnnecessarySafeCall: - active: false + active: true + UnreachableCatchBlock: + active: true UnreachableCode: active: true UnsafeCallOnNullableType: active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**'] UnsafeCast: - active: false + active: true + UnusedUnaryOperator: + active: true UselessPostfixExpression: - active: false + active: true WrongEqualsTypeParameter: active: true style: active: true + AlsoCouldBeApply: + active: false + BracesOnIfStatements: + active: false + singleLine: 'never' + multiLine: 'always' + BracesOnWhenStatements: + active: false + singleLine: 'necessary' + multiLine: 'consistent' + CanBeNonNullable: + active: false + CascadingCallWrapping: + active: false + includeElvis: true ClassOrdering: active: false CollapsibleIfStatements: active: false DataClassContainsFunctions: active: false - conversionFunctionPrefix: "to" + conversionFunctionPrefix: + - 'to' + allowOperators: false DataClassShouldBeImmutable: active: false + DestructuringDeclarationWithTooManyEntries: + active: true + maxDestructuringEntries: 4 + DoubleNegativeLambda: + active: false + negativeFunctions: + - reason: 'Use `takeIf` instead.' + value: 'takeUnless' + - reason: 'Use `all` instead.' + value: 'none' + negativeFunctionNameParts: + - 'not' + - 'non' EqualsNullCall: active: true EqualsOnSignatureLine: @@ -724,52 +433,64 @@ style: ExplicitCollectionElementAccessMethod: active: false ExplicitItLambdaParameter: - active: false + active: true ExpressionBodySyntax: active: false includeLineWrapping: false + ForbiddenAnnotation: + active: false + annotations: + - reason: 'it is a java annotation. Use `Suppress` instead.' + value: 'java.lang.SuppressWarnings' + - reason: 'it is a java annotation. Use `kotlin.Deprecated` instead.' + value: 'java.lang.Deprecated' + - reason: 'it is a java annotation. Use `kotlin.annotation.MustBeDocumented` instead.' + value: 'java.lang.annotation.Documented' + - reason: 'it is a java annotation. Use `kotlin.annotation.Target` instead.' + value: 'java.lang.annotation.Target' + - reason: 'it is a java annotation. Use `kotlin.annotation.Retention` instead.' + value: 'java.lang.annotation.Retention' + - reason: 'it is a java annotation. Use `kotlin.annotation.Repeatable` instead.' + value: 'java.lang.annotation.Repeatable' + - reason: 'Kotlin does not support @Inherited annotation, see https://youtrack.jetbrains.com/issue/KT-22265' + value: 'java.lang.annotation.Inherited' ForbiddenComment: active: false - values: ["TODO:", "FIXME:", "STOPSHIP:"] - allowedPatterns: "" + allowedPatterns: '' ForbiddenImport: active: false imports: [] - forbiddenPatterns: "" + forbiddenPatterns: '' ForbiddenMethodCall: active: false - methods: ["kotlin.io.println", "kotlin.io.print"] - ForbiddenPublicDataClass: + 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 - ignorePackages: ["*.internal", "*.internal.*"] + rules: [] ForbiddenVoid: - active: false + active: true ignoreOverridden: false ignoreUsageInGenerics: false FunctionOnlyReturningConstant: active: true ignoreOverridableFunction: true - excludedFunctions: "describeContents" - excludeAnnotatedFunction: ["dagger.Provides"] - LibraryCodeMustSpecifyReturnType: - active: true - LibraryEntitiesShouldNotBePublic: - active: false + ignoreActualFunction: true + excludedFunctions: [] LoopWithTooManyJumpStatements: active: true maxJumpCount: 1 MagicNumber: active: false - excludes: - [ - "**/test/**", - "**/androidTest/**", - "**/commonTest/**", - "**/jvmTest/**", - "**/jsTest/**", - "**/iosTest/**", - ] - ignoreNumbers: ["-1", "0", "1", "2"] + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**', '**/*.kts'] + ignoreNumbers: + - '-1' + - '0' + - '1' + - '2' ignoreHashCodeFunction: true ignorePropertyDeclaration: false ignoreLocalVariableDeclaration: false @@ -779,32 +500,43 @@ style: ignoreNamedArgument: true ignoreEnums: false ignoreRanges: false - MandatoryBracesIfStatements: - active: false + ignoreExtensionFunctions: true MandatoryBracesLoops: active: false + MaxChainedCallsOnSameLine: + active: false + maxChainedCalls: 5 MaxLineLength: active: true maxLineLength: 120 excludePackageStatements: true excludeImportStatements: true excludeCommentStatements: false - MayBeConst: - active: true + excludeRawStrings: true ModifierOrder: active: true - NestedClassesVisibility: + MultilineLambdaItParameter: active: false + MultilineRawStringIndentation: + active: false + indentSize: 4 + trimmingMethods: + - 'trimIndent' + - 'trimMargin' + NestedClassesVisibility: + active: true NewLineAtEndOfFile: active: true NoTabs: active: false + NullableBooleanCheck: + active: false + ObjectLiteralToLambda: + active: true OptionalAbstractKeyword: active: true OptionalUnit: active: false - OptionalWhenBraces: - active: false PreferToOverPairSyntax: active: false ProtectedMemberInFinalClass: @@ -812,61 +544,82 @@ style: RedundantExplicitType: active: false RedundantHigherOrderMapUsage: - active: false + active: true RedundantVisibilityModifierRule: active: false ReturnCount: active: true - max: 4 - excludedFunctions: "equals" + max: 2 + excludedFunctions: + - 'equals' excludeLabeled: false excludeReturnFromLambda: true excludeGuardClauses: false SafeCast: active: true SerialVersionUIDInSerializableClass: + active: true + StringShouldBeRawString: active: false - SpacingBetweenPackageAndImports: - active: false + maxEscapedCharacterCount: 2 + ignoredCharacters: [] ThrowsCount: - active: false + active: true max: 2 + excludeGuardClauses: false TrailingWhitespace: active: false + TrimMultilineRawString: + active: false + trimmingMethods: + - 'trimIndent' + - 'trimMargin' UnderscoresInNumericLiterals: active: false - acceptableDecimalLength: 5 - UnnecessaryAbstractClass: - active: true - excludeAnnotatedClasses: ["dagger.Module"] + acceptableLength: 4 + allowNonStandardGrouping: false UnnecessaryAnnotationUseSiteTarget: active: false UnnecessaryApply: + active: true + UnnecessaryBackticks: active: false + UnnecessaryBracesAroundTrailingLambda: + active: false + UnnecessaryFilter: + active: true UnnecessaryInheritance: active: true + UnnecessaryInnerClass: + active: false UnnecessaryLet: active: false UnnecessaryParentheses: active: false - UntilInsteadOfRangeTo: - active: false + allowForUnclearPrecedence: false UnusedImports: active: true + UnusedParameter: + active: true + allowedNames: 'ignored|expected' UnusedPrivateClass: active: true UnusedPrivateMember: - active: false - allowedNames: "(_|ignored|expected|serialVersionUID)" + active: true + allowedNames: '' + UnusedPrivateProperty: + active: true + allowedNames: '_|ignored|expected|serialVersionUID' + UseAnyOrNoneInsteadOfFind: + active: true UseArrayLiteralsInAnnotations: - active: false + active: true UseCheckNotNull: - active: false + active: true UseCheckOrError: - active: false + active: true UseDataClass: active: false - excludeAnnotatedClasses: [] allowVars: false UseEmptyCounterpart: active: false @@ -874,25 +627,36 @@ style: active: false UseIfInsteadOfWhen: active: false - UseRequire: + ignoreWhenContainingVariableDeclaration: false + UseIsNullOrEmpty: + active: true + UseLet: active: false + UseOrEmpty: + active: true + UseRequire: + active: true UseRequireNotNull: + active: true + UseSumOfInsteadOfFlatMapSize: active: false UselessCallOnNotNull: active: true UtilityClassWithPublicConstructor: active: true VarCouldBeVal: - active: false + active: true + ignoreLateinitVar: false WildcardImport: + active: true + excludeImports: + - 'java.util.*' + - kotlinx.android.synthetic.* + +formatting: + Indentation: + indentSize: 2 + NoSemicolons: active: false - excludes: - [ - "**/test/**", - "**/androidTest/**", - "**/commonTest/**", - "**/jvmTest/**", - "**/jsTest/**", - "**/iosTest/**", - ] - excludeImports: ["java.util.*", "kotlinx.android.synthetic.*"] + SpacingBetweenDeclarationsWithAnnotations: + active: false \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index d3a0e99..1044357 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,10 +16,8 @@ org.gradle.jvmargs=-Xmx1536m # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true -android.enableD8=true -android.enableR8=true - -kapt.use.worker.api=true +#org.gradle.caching=true +org.gradle.configuration-cache=true android.useAndroidX=true android.enableJetifier=true