Skip to content

Commit

Permalink
AND-81: update detekt config
Browse files Browse the repository at this point in the history
  • Loading branch information
sonulen committed Apr 27, 2024
1 parent fdb1de2 commit b5e3118
Showing 1 changed file with 27 additions and 52 deletions.
79 changes: 27 additions & 52 deletions config/detekt/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ build:
excludeCorrectable: false
weights:
complexity: 2
formatting: 1
style: 1
comments: 1

Expand Down Expand Up @@ -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: []
Expand Down Expand Up @@ -315,7 +301,6 @@ formatting:
active: true
autoCorrect: true
indentSize: 4
continuationIndentSize: 4
MaximumLineLength:
active: false # See style.MaxLineLength
maxLineLength: 120
Expand Down Expand Up @@ -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/**']
Expand All @@ -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: ''
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -548,7 +527,7 @@ potential-bugs:
active: true
IgnoredReturnValue:
active: true
restrictToAnnotatedMethods: true
restrictToConfig: true
returnValueAnnotations:
- '*.CheckResult'
- '*.CheckReturnValue'
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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: []
Expand All @@ -645,12 +622,6 @@ style:
methods:
- 'kotlin.io.print'
- 'kotlin.io.println'
ForbiddenPublicDataClass:
active: true
excludes: ['**']
ignorePackages:
- '*.internal'
- '*.internal.*'
ForbiddenVoid:
active: true
ignoreOverridden: false
Expand All @@ -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
Expand All @@ -688,8 +653,6 @@ style:
ignoreEnums: false
ignoreRanges: false
ignoreExtensionFunctions: true
MandatoryBracesIfStatements:
active: false # See formatting.MultiLineIfElse
MandatoryBracesLoops:
active: true
MaxLineLength:
Expand All @@ -716,8 +679,6 @@ style:
active: true
OptionalUnit:
active: true
OptionalWhenBraces:
active: false
PreferToOverPairSyntax:
active: true
ProtectedMemberInFinalClass:
Expand All @@ -731,7 +692,7 @@ style:
ReturnCount:
active: true
max: 2
excludedFunctions: 'equals'
excludedFunctions: ['equals']
excludeLabeled: false
excludeReturnFromLambda: true
excludeGuardClauses: false
Expand Down Expand Up @@ -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: [ '**' ]

0 comments on commit b5e3118

Please sign in to comment.