From aeb0350e507194864409593a568186a572337b86 Mon Sep 17 00:00:00 2001 From: Sebastian Roth Date: Sun, 7 Apr 2024 22:32:48 +0100 Subject: [PATCH] upgrade detekt.yml syntax --- example/android/config/detekt/detekt.yml | 207 +++++++++++++++++++---- 1 file changed, 170 insertions(+), 37 deletions(-) diff --git a/example/android/config/detekt/detekt.yml b/example/android/config/detekt/detekt.yml index 9a3e4013..ddc52c3d 100644 --- a/example/android/config/detekt/detekt.yml +++ b/example/android/config/detekt/detekt.yml @@ -1,6 +1,6 @@ build: maxIssues: 0 - weights: + weights: {} # complexity: 2 # LongParameterList: 1 # style: 1 @@ -13,7 +13,7 @@ config: processors: active: true - exclude: + exclude: [] # - 'DetektProgressListener' # - 'FunctionCountProcessor' # - 'PropertyCountProcessor' @@ -70,7 +70,7 @@ complexity: nestingFunctions: run,let,apply,with,also,use,forEach,isNotNull,ifNull LabeledExpression: active: false - ignoredLabels: "" + ignoredLabels: [] LargeClass: active: true threshold: 600 @@ -89,14 +89,24 @@ complexity: threshold: 4 StringLiteralDuplication: active: false - excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + excludes: + - "**/test/**" + - "**/androidTest/**" + - "**/*.Test.kt" + - "**/*.Spec.kt" + - "**/*.Spek.kt" threshold: 3 ignoreAnnotation: true excludeStringsWithLessThan5Characters: true ignoreStringsRegex: '$^' TooManyFunctions: active: true - excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + excludes: + - "**/test/**" + - "**/androidTest/**" + - "**/*.Test.kt" + - "**/*.Spec.kt" + - "**/*.Spek.kt" thresholdInFiles: 11 thresholdInClasses: 11 thresholdInInterfaces: 11 @@ -143,10 +153,19 @@ exceptions: active: true ExceptionRaisedInUnexpectedLocation: active: false - methodNames: 'toString,hashCode,equals,finalize' + methodNames: + - toString + - hashCode + - equals + - finalize InstanceOfCheckForException: active: false - excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + excludes: + - "**/test/**" + - "**/androidTest/**" + - "**/*.Test.kt" + - "**/*.Spec.kt" + - "**/*.Spek.kt" NotImplementedDeclaration: active: false PrintStackTrace: @@ -158,7 +177,11 @@ exceptions: ignoreLabeled: false SwallowedException: active: false - ignoredExceptionTypes: 'InterruptedException,NumberFormatException,ParseException,MalformedURLException' + ignoredExceptionTypes: + - InterruptedException + - NumberFormatException + - ParseException + - MalformedURLException allowedExceptionNameRegex: "^(_|(ignore|expected).*)" ThrowingExceptionFromFinally: active: false @@ -166,12 +189,20 @@ exceptions: active: false ThrowingExceptionsWithoutMessageOrCause: active: false - exceptions: 'IllegalArgumentException,IllegalStateException,IOException' + exceptions: + - IllegalArgumentException + - IllegalStateException + - IOException ThrowingNewInstanceOfSameException: active: false TooGenericExceptionCaught: active: true - excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + excludes: + - "**/test/**" + - "**/androidTest/**" + - "**/*.Test.kt" + - "**/*.Spec.kt" + - "**/*.Spek.kt" exceptionNames: - ArrayIndexOutOfBoundsException - Error @@ -296,40 +327,80 @@ naming: active: true ClassNaming: active: true - excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + excludes: + - "**/test/**" + - "**/androidTest/**" + - "**/*.Test.kt" + - "**/*.Spec.kt" + - "**/*.Spek.kt" classPattern: '[A-Z$][a-zA-Z0-9$]*' ConstructorParameterNaming: active: true - excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + excludes: + - "**/test/**" + - "**/androidTest/**" + - "**/*.Test.kt" + - "**/*.Spec.kt" + - "**/*.Spek.kt" parameterPattern: '[a-z][A-Za-z0-9]*' privateParameterPattern: '[a-z][A-Za-z0-9]*' excludeClassPattern: '$^' ignoreOverridden: true EnumNaming: active: true - excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + excludes: + - "**/test/**" + - "**/androidTest/**" + - "**/*.Test.kt" + - "**/*.Spec.kt" + - "**/*.Spek.kt" enumEntryPattern: '^[A-Z][_a-zA-Z0-9]*' ForbiddenClassName: active: false - excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" - forbiddenName: '' + excludes: + - "**/test/**" + - "**/androidTest/**" + - "**/*.Test.kt" + - "**/*.Spec.kt" + - "**/*.Spek.kt" + forbiddenName: [] FunctionMaxLength: active: false - excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + excludes: + - "**/test/**" + - "**/androidTest/**" + - "**/*.Test.kt" + - "**/*.Spec.kt" + - "**/*.Spek.kt" maximumFunctionNameLength: 30 FunctionMinLength: active: false - excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + excludes: + - "**/test/**" + - "**/androidTest/**" + - "**/*.Test.kt" + - "**/*.Spec.kt" + - "**/*.Spek.kt" minimumFunctionNameLength: 3 FunctionNaming: active: true - excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + excludes: + - "**/test/**" + - "**/androidTest/**" + - "**/*.Test.kt" + - "**/*.Spec.kt" + - "**/*.Spek.kt" functionPattern: '^([a-z$][a-zA-Z$0-9]*)|(`.*`)$' excludeClassPattern: '$^' ignoreOverridden: true FunctionParameterNaming: active: true - excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + excludes: + - "**/test/**" + - "**/androidTest/**" + - "**/*.Test.kt" + - "**/*.Spec.kt" + - "**/*.Spek.kt" parameterPattern: '[a-z][A-Za-z0-9]*' excludeClassPattern: '$^' ignoreOverriddenFunctions: true @@ -343,31 +414,61 @@ naming: ignoreOverriddenFunction: true ObjectPropertyNaming: active: true - excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + excludes: + - "**/test/**" + - "**/androidTest/**" + - "**/*.Test.kt" + - "**/*.Spec.kt" + - "**/*.Spek.kt" 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/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + excludes: + - "**/test/**" + - "**/androidTest/**" + - "**/*.Test.kt" + - "**/*.Spec.kt" + - "**/*.Spek.kt" packagePattern: '^[a-z]+(\.[a-z][A-Za-z0-9]*)*$' TopLevelPropertyNaming: active: true - excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + excludes: + - "**/test/**" + - "**/androidTest/**" + - "**/*.Test.kt" + - "**/*.Spec.kt" + - "**/*.Spek.kt" 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/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + excludes: + - "**/test/**" + - "**/androidTest/**" + - "**/*.Test.kt" + - "**/*.Spec.kt" + - "**/*.Spek.kt" maximumVariableNameLength: 64 VariableMinLength: active: false - excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + excludes: + - "**/test/**" + - "**/androidTest/**" + - "**/*.Test.kt" + - "**/*.Spec.kt" + - "**/*.Spek.kt" minimumVariableNameLength: 1 VariableNaming: active: true - excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + excludes: + - "**/test/**" + - "**/androidTest/**" + - "**/*.Test.kt" + - "**/*.Spec.kt" + - "**/*.Spek.kt" variablePattern: '[a-z][A-Za-z0-9]*' privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*' excludeClassPattern: '$^' @@ -379,10 +480,20 @@ performance: active: true ForEachOnRange: active: true - excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + excludes: + - "**/test/**" + - "**/androidTest/**" + - "**/*.Test.kt" + - "**/*.Spec.kt" + - "**/*.Spek.kt" SpreadOperator: active: true - excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + excludes: + - "**/test/**" + - "**/androidTest/**" + - "**/*.Test.kt" + - "**/*.Spec.kt" + - "**/*.Spek.kt" UnnecessaryTemporaryInstantiation: active: true @@ -410,7 +521,12 @@ potential-bugs: active: true LateinitUsage: active: false - excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" + excludes: + - "**/test/**" + - "**/androidTest/**" + - "**/*.Test.kt" + - "**/*.Spec.kt" + - "**/*.Spek.kt" excludeAnnotatedProperties: "" ignoreOnClassesPattern: "" MissingWhenCase: @@ -436,7 +552,8 @@ style: active: false DataClassContainsFunctions: active: false - conversionFunctionPrefix: 'to' + conversionFunctionPrefix: + - 'to' DataClassShouldBeImmutable: active: false EqualsNullCall: @@ -450,11 +567,14 @@ style: includeLineWrapping: false ForbiddenComment: active: true - values: 'TODO:,FIXME:,STOPSHIP:' + values: + - 'TODO:' + - 'FIXME:' + - 'STOPSHIP:' allowedPatterns: "" ForbiddenImport: active: false - imports: '' + imports: [] forbiddenPatterns: "" ForbiddenVoid: active: false @@ -463,7 +583,8 @@ style: FunctionOnlyReturningConstant: active: true ignoreOverridableFunction: true - excludedFunctions: 'describeContents' + excludedFunctions: + - 'describeContents' excludeAnnotatedFunction: "dagger.Provides" LibraryCodeMustSpecifyReturnType: active: true @@ -472,8 +593,13 @@ style: maxJumpCount: 1 MagicNumber: active: true - excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" - ignoreNumbers: '-1,0,1,2' + excludes: + - "**/test/**" + - "**/androidTest/**" + - "**/*.Test.kt" + - "**/*.Spec.kt" + - "**/*.Spek.kt" + ignoreNumbers: ['-1','0','1','2'] ignoreHashCodeFunction: true ignorePropertyDeclaration: false ignoreLocalVariableDeclaration: false @@ -519,7 +645,7 @@ style: ReturnCount: active: true max: 2 - excludedFunctions: "equals" + excludedFunctions: ["equals"] excludeLabeled: false excludeReturnFromLambda: true excludeGuardClauses: false @@ -577,5 +703,12 @@ style: active: false WildcardImport: active: true - excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" - excludeImports: 'java.util.*,kotlinx.android.synthetic.*' + excludes: + - "**/test/**" + - "**/androidTest/**" + - "**/*.Test.kt" + - "**/*.Spec.kt" + - "**/*.Spek.kt" + excludeImports: + - 'java.util.*' + - 'kotlinx.android.synthetic.*'