Skip to content

Commit

Permalink
upgrade detekt.yml syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
ened committed Apr 7, 2024
1 parent 7c4e201 commit aeb0350
Showing 1 changed file with 170 additions and 37 deletions.
207 changes: 170 additions & 37 deletions example/android/config/detekt/detekt.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
build:
maxIssues: 0
weights:
weights: {}
# complexity: 2
# LongParameterList: 1
# style: 1
Expand All @@ -13,7 +13,7 @@ config:

processors:
active: true
exclude:
exclude: []
# - 'DetektProgressListener'
# - 'FunctionCountProcessor'
# - 'PropertyCountProcessor'
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -158,20 +177,32 @@ exceptions:
ignoreLabeled: false
SwallowedException:
active: false
ignoredExceptionTypes: 'InterruptedException,NumberFormatException,ParseException,MalformedURLException'
ignoredExceptionTypes:
- InterruptedException
- NumberFormatException
- ParseException
- MalformedURLException
allowedExceptionNameRegex: "^(_|(ignore|expected).*)"
ThrowingExceptionFromFinally:
active: false
ThrowingExceptionInMain:
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
Expand Down Expand Up @@ -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
Expand All @@ -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: '$^'
Expand All @@ -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

Expand Down Expand Up @@ -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:
Expand All @@ -436,7 +552,8 @@ style:
active: false
DataClassContainsFunctions:
active: false
conversionFunctionPrefix: 'to'
conversionFunctionPrefix:
- 'to'
DataClassShouldBeImmutable:
active: false
EqualsNullCall:
Expand All @@ -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
Expand All @@ -463,7 +583,8 @@ style:
FunctionOnlyReturningConstant:
active: true
ignoreOverridableFunction: true
excludedFunctions: 'describeContents'
excludedFunctions:
- 'describeContents'
excludeAnnotatedFunction: "dagger.Provides"
LibraryCodeMustSpecifyReturnType:
active: true
Expand All @@ -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
Expand Down Expand Up @@ -519,7 +645,7 @@ style:
ReturnCount:
active: true
max: 2
excludedFunctions: "equals"
excludedFunctions: ["equals"]
excludeLabeled: false
excludeReturnFromLambda: true
excludeGuardClauses: false
Expand Down Expand Up @@ -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.*'

0 comments on commit aeb0350

Please sign in to comment.