diff --git a/config/detekt/detekt.yml b/config/detekt/detekt.yml index 01a28ee..2cfad52 100644 --- a/config/detekt/detekt.yml +++ b/config/detekt/detekt.yml @@ -3,7 +3,6 @@ build: excludeCorrectable: false weights: complexity: 2 - formatting: 1 style: 1 comments: 1 @@ -90,22 +89,9 @@ complexity: threshold: 10 includeStaticDeclarations: false includePrivateDeclarations: false - ComplexMethod: + CognitiveComplexMethod: active: true threshold: 15 - ignoreSingleWhenExpression: false - ignoreSimpleWhenEntries: false - ignoreNestingFunctions: false - nestingFunctions: - - 'also' - - 'apply' - - 'forEach' - - 'isNotNull' - - 'ifNull' - - 'let' - - 'run' - - 'use' - - 'with' LabeledExpression: active: false ignoredLabels: [] @@ -315,7 +301,6 @@ formatting: active: true autoCorrect: true indentSize: 4 - continuationIndentSize: 4 MaximumLineLength: active: false # See style.MaxLineLength maxLineLength: 120 @@ -428,7 +413,6 @@ naming: parameterPattern: '[a-z][A-Za-z0-9]*' privateParameterPattern: '[a-z][A-Za-z0-9]*' excludeClassPattern: '$^' - ignoreOverridden: true EnumNaming: active: true excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] @@ -450,13 +434,11 @@ naming: excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] functionPattern: '([a-z][a-zA-Z0-9]*)|(`.*`)' excludeClassPattern: '$^' - ignoreOverridden: true FunctionParameterNaming: active: true excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] parameterPattern: '[a-z][A-Za-z0-9]*' excludeClassPattern: '$^' - ignoreOverridden: true InvalidPackageDeclaration: active: false rootPackage: '' @@ -505,7 +487,6 @@ naming: variablePattern: '[a-z][A-Za-z0-9]*' privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*' excludeClassPattern: '$^' - ignoreOverridden: true performance: active: true @@ -529,13 +510,11 @@ potential-bugs: CastToNullableType: active: true Deprecation: - active: true + active: false DontDowncastCollectionTypes: active: true DoubleMutabilityForCollection: active: true - DuplicateCaseInWhenExpression: - active: true EqualsAlwaysReturnsTrueOrFalse: active: true EqualsWithHashCodeExist: @@ -548,7 +527,7 @@ potential-bugs: active: true IgnoredReturnValue: active: true - restrictToAnnotatedMethods: true + restrictToConfig: true returnValueAnnotations: - '*.CheckResult' - '*.CheckReturnValue' @@ -574,13 +553,8 @@ potential-bugs: MissingPackageDeclaration: active: true excludes: ['**/*.kts'] - MissingWhenCase: - active: true - allowElseExpression: true NullableToStringCall: active: true - RedundantElseInWhen: - active: true UnconditionalJumpStatementInLoop: active: true UnnecessaryNotNullOperator: @@ -605,13 +579,15 @@ potential-bugs: style: active: true + BracesOnWhenStatements: + active: false ClassOrdering: active: true CollapsibleIfStatements: active: true DataClassContainsFunctions: active: false - conversionFunctionPrefix: 'to' + conversionFunctionPrefix: ['to'] DataClassShouldBeImmutable: active: true DestructuringDeclarationWithTooManyEntries: @@ -631,11 +607,12 @@ style: includeLineWrapping: false ForbiddenComment: active: true - values: - - 'FIXME' - - 'STOPSHIP' + comments: + - reason: 'Forbidden FIXME todo marker in comment, please fix the problem.' + value: 'FIXME:' + - reason: 'Forbidden STOPSHIP todo marker in comment, please address the problem before shipping the code.' + value: 'STOPSHIP:' allowedPatterns: '' - customMessage: '' ForbiddenImport: active: false imports: [] @@ -645,12 +622,6 @@ style: methods: - 'kotlin.io.print' - 'kotlin.io.println' - ForbiddenPublicDataClass: - active: true - excludes: ['**'] - ignorePackages: - - '*.internal' - - '*.internal.*' ForbiddenVoid: active: true ignoreOverridden: false @@ -659,13 +630,7 @@ style: active: true ignoreOverridableFunction: true ignoreActualFunction: true - excludedFunctions: '' - LibraryCodeMustSpecifyReturnType: - active: true - excludes: ['**'] - LibraryEntitiesShouldNotBePublic: - active: true - excludes: ['**'] + excludedFunctions: [''] LoopWithTooManyJumpStatements: active: true maxJumpCount: 1 @@ -688,8 +653,6 @@ style: ignoreEnums: false ignoreRanges: false ignoreExtensionFunctions: true - MandatoryBracesIfStatements: - active: false # See formatting.MultiLineIfElse MandatoryBracesLoops: active: true MaxLineLength: @@ -716,8 +679,6 @@ style: active: true OptionalUnit: active: true - OptionalWhenBraces: - active: false PreferToOverPairSyntax: active: true ProtectedMemberInFinalClass: @@ -731,7 +692,7 @@ style: ReturnCount: active: true max: 2 - excludedFunctions: 'equals' + excludedFunctions: ['equals'] excludeLabeled: false excludeReturnFromLambda: true excludeGuardClauses: false @@ -809,3 +770,17 @@ style: excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] excludeImports: - 'java.util.*' + +libraries: + ForbiddenPublicDataClass: + active: true + excludes: [ '**' ] + ignorePackages: + - '*.internal' + - '*.internal.*' + LibraryCodeMustSpecifyReturnType: + active: true + excludes: [ '**' ] + LibraryEntitiesShouldNotBePublic: + active: true + excludes: [ '**' ]