From 29fdbc191308dca7e3deaceff27abbfcb83f4004 Mon Sep 17 00:00:00 2001 From: Jaskq Date: Sat, 18 Jan 2025 12:43:52 +0530 Subject: [PATCH 1/2] Updated detekt configuration: * Increased the `functionThreshold` for `LongParameterList` from 6 to 8. * Enabled `ignoreDefaultParameters` for `LongParameterList`. * Updated `functionPattern` to allow uppercase letters at the beginning. * Add `ignoreAnnotatedFunctions` to `['Preview']` * Add `ignoreAnnotated` to `['Composable']` * Updated `constantPattern` to accept uppercase letters followed by alphanumeric characters. * Enabled `ignorePropertyDeclaration` for `MagicNumber`. --- config/detekt/detekt.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/config/detekt/detekt.yml b/config/detekt/detekt.yml index 10e5a4851..cc8186acc 100644 --- a/config/detekt/detekt.yml +++ b/config/detekt/detekt.yml @@ -79,9 +79,9 @@ complexity: threshold: 60 LongParameterList: active: true - functionThreshold: 6 + functionThreshold: 8 constructorThreshold: 6 - ignoreDefaultParameters: false + ignoreDefaultParameters: true MethodOverloading: active: false threshold: 6 @@ -106,6 +106,7 @@ complexity: ignoreDeprecated: false ignorePrivate: false ignoreOverridden: false + ignoreAnnotatedFunctions: ['Preview'] coroutines: active: true @@ -230,9 +231,10 @@ naming: FunctionNaming: active: true excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" - functionPattern: '^([a-z$][a-zA-Z$0-9]*)|(`.*`)$' + functionPattern: '^([a-zA-Z$][a-zA-Z$0-9]*)|(`.*`)$' excludeClassPattern: '$^' ignoreOverridden: true + ignoreAnnotated: ['Composable'] FunctionParameterNaming: active: true excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" @@ -260,7 +262,7 @@ naming: TopLevelPropertyNaming: active: true excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" - constantPattern: '[A-Z][_A-Z0-9]*' + constantPattern: '[A-Z][A-Za-z0-9]*' propertyPattern: '[A-Za-z][_A-Za-z0-9]*' privatePropertyPattern: '_?[A-Za-z][_A-Za-z0-9]*' VariableMaxLength: @@ -391,7 +393,7 @@ style: excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" ignoreNumbers: '-1,0,1,2' ignoreHashCodeFunction: true - ignorePropertyDeclaration: false + ignorePropertyDeclaration: true ignoreLocalVariableDeclaration: false ignoreConstantDeclaration: true ignoreCompanionObjectPropertyDeclaration: true From c11f8561db92ddca73a5fc8c5d83cabb317452da Mon Sep 17 00:00:00 2001 From: Jaskq Date: Wed, 22 Jan 2025 15:09:22 +0530 Subject: [PATCH 2/2] Updated detekt configuration: - Removed 'Preview' from `ignoreAnnotatedFunctions` in Complexity rule set. 'not supported in this version' - Updated `constantPattern` to `[A-Z][_A-Z0-9]*` for TopLevelPropertyNaming rule. - Added 'Preview' to `ignoreAnnotated` in UnusedPrivateMember rule set. --- config/detekt/detekt.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/detekt/detekt.yml b/config/detekt/detekt.yml index cc8186acc..2132fb17e 100644 --- a/config/detekt/detekt.yml +++ b/config/detekt/detekt.yml @@ -106,7 +106,6 @@ complexity: ignoreDeprecated: false ignorePrivate: false ignoreOverridden: false - ignoreAnnotatedFunctions: ['Preview'] coroutines: active: true @@ -262,7 +261,7 @@ naming: TopLevelPropertyNaming: active: true excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" - constantPattern: '[A-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: @@ -476,6 +475,7 @@ style: UnusedPrivateMember: active: false allowedNames: "(_|ignored|expected|serialVersionUID)" + ignoreAnnotated: ['Preview'] UseArrayLiteralsInAnnotations: active: false UseCheckOrError: