From 42816b57a69c2a7a98f9b87ecfe602a6a08a7a1d Mon Sep 17 00:00:00 2001 From: kardelio Date: Thu, 5 Oct 2023 12:43:24 +0200 Subject: [PATCH] Issue 191 Detekt into project --- .github/workflows/app-build.yml | 2 + app/build.gradle | 8 +- .../adapters/GridListItemAdapter.kt | 12 +- .../adapters/LineListItemAdapter.kt | 12 +- .../presentation/explore/ExploreFragment.kt | 18 +- config/detekt/detekt.yml | 723 ++++++++++++++++++ 6 files changed, 753 insertions(+), 22 deletions(-) create mode 100644 config/detekt/detekt.yml diff --git a/.github/workflows/app-build.yml b/.github/workflows/app-build.yml index bf8de947..22e1ea75 100644 --- a/.github/workflows/app-build.yml +++ b/.github/workflows/app-build.yml @@ -32,6 +32,8 @@ jobs: uses: actions/setup-java@v1 with: java-version: 11 + #- name: Check Detekt + # run: chmod +x .github/scripts/gradlew_recursive.sh ; .github/scripts/gradlew_recursive.sh detekt - name: Build project run: chmod +x .github/scripts/gradlew_recursive.sh ; .github/scripts/gradlew_recursive.sh assembleDebug - name: Zip artifacts diff --git a/app/build.gradle b/app/build.gradle index 2e848cf2..2d08d0fd 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,9 +8,8 @@ plugins { alias libs.plugins.spotless alias libs.plugins.navigation.safeargs id "org.jetbrains.kotlin.plugin.serialization" version "1.7.0" - + id "io.gitlab.arturbosch.detekt" version "1.22.0" } -apply plugin: 'kotlin-android-extensions' android { compileSdk 34 @@ -136,6 +135,11 @@ task wrapper(type: Wrapper) { gradleVersion = '7.2' } +detekt { + config = files("${project.rootDir.absolutePath}/config/detekt/detekt.yml") + buildUponDefaultConfig = true +} + ktlint { // android.set(true) // reporters { diff --git a/app/src/main/java/com/hieuwu/groceriesstore/presentation/adapters/GridListItemAdapter.kt b/app/src/main/java/com/hieuwu/groceriesstore/presentation/adapters/GridListItemAdapter.kt index 5c61f6b1..da280f0a 100644 --- a/app/src/main/java/com/hieuwu/groceriesstore/presentation/adapters/GridListItemAdapter.kt +++ b/app/src/main/java/com/hieuwu/groceriesstore/presentation/adapters/GridListItemAdapter.kt @@ -1,18 +1,19 @@ package com.hieuwu.groceriesstore.presentation.adapters import android.view.LayoutInflater +import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.ListAdapter import androidx.recyclerview.widget.RecyclerView +import com.hieuwu.groceriesstore.R import com.hieuwu.groceriesstore.databinding.LayoutGridListItemBinding import com.hieuwu.groceriesstore.domain.models.ProductModel -import kotlinx.android.synthetic.main.layout_grid_list_item.view.* -class GridListItemAdapter(val onClickListener: OnClickListener) : +class GridListItemAdapter(private val onClickListener: OnClickListener) : ListAdapter(DiffCallback) { - class ProductGridViewHolder(private var binding: LayoutGridListItemBinding) : + class ProductGridViewHolder(private val binding: LayoutGridListItemBinding) : RecyclerView.ViewHolder(binding.root) { fun bind(productModel: ProductModel) { binding.product = productModel @@ -26,7 +27,7 @@ class GridListItemAdapter(val onClickListener: OnClickListener) : onClickListener.onClick(product) } - holder.itemView.product_add_button.setOnClickListener { + holder.itemView.findViewById(R.id.product_add_button).setOnClickListener { onClickListener.addToCartListener(product) } @@ -34,7 +35,8 @@ class GridListItemAdapter(val onClickListener: OnClickListener) : } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ProductGridViewHolder { - return ProductGridViewHolder(LayoutGridListItemBinding.inflate(LayoutInflater.from(parent.context))) + val binding = LayoutGridListItemBinding.inflate(LayoutInflater.from(parent.context), parent, false) + return ProductGridViewHolder(binding) } companion object DiffCallback : DiffUtil.ItemCallback() { diff --git a/app/src/main/java/com/hieuwu/groceriesstore/presentation/adapters/LineListItemAdapter.kt b/app/src/main/java/com/hieuwu/groceriesstore/presentation/adapters/LineListItemAdapter.kt index 43141c5a..35562fdb 100644 --- a/app/src/main/java/com/hieuwu/groceriesstore/presentation/adapters/LineListItemAdapter.kt +++ b/app/src/main/java/com/hieuwu/groceriesstore/presentation/adapters/LineListItemAdapter.kt @@ -8,12 +8,11 @@ import androidx.recyclerview.widget.ListAdapter import androidx.recyclerview.widget.RecyclerView import com.hieuwu.groceriesstore.databinding.LayoutLineListItemBinding import com.hieuwu.groceriesstore.domain.models.LineItemModel -import kotlinx.android.synthetic.main.layout_line_list_item.view.* class LineListItemAdapter(val onClickListener: OnClickListener, val context: Context) : ListAdapter(DiffCallback) { - class LineItemViewHolder(private var binding: LayoutLineListItemBinding) : + class LineItemViewHolder(val binding: LayoutLineListItemBinding) : RecyclerView.ViewHolder(binding.root) { fun bind(lineItemModel: LineItemModel) { binding.lineItem = lineItemModel @@ -28,15 +27,15 @@ class LineListItemAdapter(val onClickListener: OnClickListener, val context: Con override fun onBindViewHolder(holder: LineItemViewHolder, position: Int) { val lineItem = getItem(position) - holder.itemView.plus_btn.setOnClickListener { + holder.binding.plusBtn.setOnClickListener { onClickListener.onPlusClick(lineItem) } - holder.itemView.minus_btn.setOnClickListener { + holder.binding.minusBtn.setOnClickListener { onClickListener.onMinusClick(lineItem) } - holder.itemView.delete_btn.setOnClickListener { + holder.binding.deleteBtn.setOnClickListener { onClickListener.onRemoveItem(lineItem) } @@ -44,7 +43,8 @@ class LineListItemAdapter(val onClickListener: OnClickListener, val context: Con } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): LineItemViewHolder { - return LineItemViewHolder(LayoutLineListItemBinding.inflate(LayoutInflater.from(parent.context))) + val binding = LayoutLineListItemBinding.inflate(LayoutInflater.from(parent.context), parent, false) + return LineItemViewHolder(binding) } companion object DiffCallback : DiffUtil.ItemCallback() { diff --git a/app/src/main/java/com/hieuwu/groceriesstore/presentation/explore/ExploreFragment.kt b/app/src/main/java/com/hieuwu/groceriesstore/presentation/explore/ExploreFragment.kt index bf861b4d..b281616d 100644 --- a/app/src/main/java/com/hieuwu/groceriesstore/presentation/explore/ExploreFragment.kt +++ b/app/src/main/java/com/hieuwu/groceriesstore/presentation/explore/ExploreFragment.kt @@ -5,6 +5,7 @@ import android.graphics.Color import android.os.Bundle import android.view.LayoutInflater import android.view.View +import android.view.View.* import android.view.ViewGroup import android.widget.EditText import androidx.appcompat.widget.AppCompatImageView @@ -20,7 +21,6 @@ import com.hieuwu.groceriesstore.databinding.FragmentExploreBinding import com.hieuwu.groceriesstore.presentation.adapters.CategoryItemAdapter import com.hieuwu.groceriesstore.presentation.adapters.GridListItemAdapter import dagger.hilt.android.AndroidEntryPoint -import kotlinx.android.synthetic.main.fragment_main.* import kotlinx.coroutines.launch import timber.log.Timber @@ -36,7 +36,7 @@ class ExploreFragment : Fragment() { savedInstanceState: Bundle? ): View? { - binding = DataBindingUtil.inflate( + binding = DataBindingUtil.inflate( inflater, R.layout.fragment_explore, container, false ) binding.viewModel = viewModel @@ -93,8 +93,8 @@ class ExploreFragment : Fragment() { if (it.isEmpty()) { Timber.d("Empty") } else { - binding.productRecyclerview.visibility = View.VISIBLE - binding.animationLayout.visibility = View.GONE + binding.productRecyclerview.visibility = VISIBLE + binding.animationLayout.visibility = GONE Timber.d("Has item") } } @@ -130,14 +130,14 @@ class ExploreFragment : Fragment() { Timber.d("Search focused") // Hide category list // Show search result list with empty list product - binding.categoryRecyclerview.visibility = View.GONE + binding.categoryRecyclerview.visibility = GONE } binding.searchView.setOnQueryTextFocusChangeListener { _, _ -> Timber.d("Search focused") // Hide category list // Show search result list with empty list product - binding.categoryRecyclerview.visibility = View.GONE + binding.categoryRecyclerview.visibility = GONE } val closeSearchButton = @@ -149,9 +149,9 @@ class ExploreFragment : Fragment() { // Show category list // Clear search result // Hide search result - binding.productRecyclerview.visibility = View.GONE - binding.categoryRecyclerview.visibility = View.VISIBLE - binding.animationLayout.visibility = View.GONE + binding.productRecyclerview.visibility = GONE + binding.categoryRecyclerview.visibility = VISIBLE + binding.animationLayout.visibility = GONE } } } diff --git a/config/detekt/detekt.yml b/config/detekt/detekt.yml new file mode 100644 index 00000000..04603231 --- /dev/null +++ b/config/detekt/detekt.yml @@ -0,0 +1,723 @@ +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 + 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: '' + 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 + 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: true + 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 + WildcardImport: + active: true + excludeImports: + - 'java.util.*' \ No newline at end of file