From 0836d61f519211e62f1d8c4453023470006e8803 Mon Sep 17 00:00:00 2001 From: Jesus Recio Date: Thu, 14 Nov 2024 09:20:40 +0100 Subject: [PATCH] feat: update detekt version to 1.23.3, adding new fields and removed deprecated ones --- config/detekt/detekt.yml | 53 +++++++++++++-------------------------- gradle/libs.versions.toml | 2 +- 2 files changed, 19 insertions(+), 36 deletions(-) diff --git a/config/detekt/detekt.yml b/config/detekt/detekt.yml index 1c0e0dec11c..dc9eeda31f1 100644 --- a/config/detekt/detekt.yml +++ b/config/detekt/detekt.yml @@ -83,6 +83,9 @@ comments: complexity: active: true + CognitiveComplexMethod: + active: false + threshold: 15 ComplexCondition: active: true threshold: 5 @@ -91,7 +94,7 @@ complexity: threshold: 10 includeStaticDeclarations: false includePrivateDeclarations: false - ComplexMethod: + CyclomaticComplexMethod: active: true threshold: 15 ignoreSingleWhenExpression: false @@ -284,7 +287,6 @@ naming: BooleanPropertyNaming: active: false allowedPattern: '^(is|has|are)' - ignoreOverridden: true ClassNaming: active: true classPattern: '[A-Z][a-zA-Z0-9]*' @@ -355,7 +357,6 @@ naming: variablePattern: '[a-z][A-Za-z0-9]*' privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*' excludeClassPattern: '$^' - ignoreOverridden: true performance: active: true @@ -393,8 +394,6 @@ potential-bugs: - 'java.util.HashSet' - 'java.util.LinkedHashMap' - 'java.util.HashMap' - DuplicateCaseInWhenExpression: - active: true ElseCaseInsteadOfExhaustiveWhen: active: false EqualsAlwaysReturnsTrueOrFalse: @@ -409,7 +408,7 @@ potential-bugs: active: false IgnoredReturnValue: active: false - restrictToAnnotatedMethods: true + restrictToConfig: true returnValueAnnotations: - '*.CheckResult' - '*.CheckReturnValue' @@ -436,15 +435,10 @@ potential-bugs: MissingPackageDeclaration: active: false excludes: ['**/*.kts'] - MissingWhenCase: - active: true - allowElseExpression: true NullCheckOnMutableProperty: active: false NullableToStringCall: active: false - RedundantElseInWhen: - active: true UnconditionalJumpStatementInLoop: active: false UnnecessaryNotNullOperator: @@ -469,6 +463,14 @@ potential-bugs: style: active: true + AlsoCouldBeApply: + active: false + BracesOnIfStatements: + singleLine: 'never' + multiLine: 'always' + BracesOnWhenStatements: + singleLine: 'necessary' + multiLine: 'consistent' CanBeNonNullable: active: false ClassOrdering: @@ -477,7 +479,8 @@ style: active: false DataClassContainsFunctions: active: false - conversionFunctionPrefix: 'to' + allowOperators: false + conversionFunctionPrefix: ['to'] DataClassShouldBeImmutable: active: false DestructuringDeclarationWithTooManyEntries: @@ -496,12 +499,8 @@ style: includeLineWrapping: false ForbiddenComment: active: true - values: - - 'FIXME:' - - 'STOPSHIP:' - - 'TODO:' allowedPatterns: '' - customMessage: '' + comments: ['FIXME:', 'STOPSHIP:', 'TODO:'] ForbiddenImport: active: false imports: [] @@ -511,12 +510,6 @@ style: methods: - 'kotlin.io.print' - 'kotlin.io.println' - ForbiddenPublicDataClass: - active: true - excludes: ['**'] - ignorePackages: - - '*.internal' - - '*.internal.*' ForbiddenVoid: active: false ignoreOverridden: false @@ -525,13 +518,7 @@ style: active: true ignoreOverridableFunction: true ignoreActualFunction: true - excludedFunctions: '' - LibraryCodeMustSpecifyReturnType: - active: true - excludes: ['**'] - LibraryEntitiesShouldNotBePublic: - active: true - excludes: ['**'] + excludedFunctions: [] LoopWithTooManyJumpStatements: active: true maxJumpCount: 1 @@ -553,8 +540,6 @@ style: ignoreEnums: false ignoreRanges: false ignoreExtensionFunctions: true - MandatoryBracesIfStatements: - active: false MandatoryBracesLoops: active: false MaxLineLength: @@ -581,8 +566,6 @@ style: active: true OptionalUnit: active: false - OptionalWhenBraces: - active: false PreferToOverPairSyntax: active: false ProtectedMemberInFinalClass: @@ -596,7 +579,7 @@ style: ReturnCount: active: true max: 2 - excludedFunctions: 'equals' + excludedFunctions: ['equals'] excludeLabeled: false excludeReturnFromLambda: true excludeGuardClauses: false diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0611eb9cb03..0aa22203c6c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -22,7 +22,7 @@ androidxTestMonitor = "1.6.1" androidxTestUiAutomator ="2.2.0" androidxWork = "2.8.1" coil = "2.2.2" -detekt="1.20.0" +detekt="1.23.3" dexopener = "2.0.5" disklrucache = "2.0.2" media3 ="1.1.1"