570 lines
14 KiB
YAML
Executable File
570 lines
14 KiB
YAML
Executable File
comments:
|
|
active: true
|
|
AbsentOrWrongFileLicense:
|
|
active: false
|
|
licenseTemplateFile: 'license.template'
|
|
licenseTemplateIsRegex: false
|
|
CommentOverPrivateFunction:
|
|
active: false
|
|
CommentOverPrivateProperty:
|
|
active: false
|
|
DeprecatedBlockTag:
|
|
active: false
|
|
EndOfSentenceFormat:
|
|
active: false
|
|
endOfSentenceFormat: '([.?!][ \t\n\r\f<])|([.?!:]$)'
|
|
UndocumentedPublicClass:
|
|
active: false
|
|
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
|
|
searchInNestedClass: true
|
|
searchInInnerClass: true
|
|
searchInInnerObject: true
|
|
searchInInnerInterface: true
|
|
UndocumentedPublicFunction:
|
|
active: false
|
|
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
|
|
UndocumentedPublicProperty:
|
|
active: false
|
|
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
|
|
|
|
complexity:
|
|
active: true
|
|
ComplexCondition:
|
|
active: true
|
|
threshold: 4
|
|
StringLiteralDuplication:
|
|
active: true
|
|
excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**' ]
|
|
threshold: 5
|
|
ignoreAnnotation: true
|
|
excludeStringsWithLessThan5Characters: true
|
|
ignoreStringsRegex: '$^'
|
|
|
|
ComplexInterface:
|
|
active: true
|
|
threshold: 10
|
|
includeStaticDeclarations: false
|
|
includePrivateDeclarations: false
|
|
CyclomaticComplexMethod:
|
|
active: true
|
|
threshold: 16
|
|
ignoreSingleWhenExpression: true
|
|
ignoreSimpleWhenEntries: true
|
|
ignoreNestingFunctions: true
|
|
nestingFunctions:
|
|
- 'run'
|
|
- 'let'
|
|
- 'apply'
|
|
- 'with'
|
|
- 'also'
|
|
- 'use'
|
|
- 'forEach'
|
|
- 'isNotNull'
|
|
- 'ifNull'
|
|
LargeClass:
|
|
active: false
|
|
threshold: 600
|
|
excludes: ['**/test/**', '**/*.Test.kt', '**/*.Spec.kt']
|
|
MethodOverloading:
|
|
active: true
|
|
TooManyFunctions:
|
|
active: true
|
|
excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**' ]
|
|
thresholdInFiles: 24
|
|
thresholdInClasses: 24
|
|
thresholdInInterfaces: 24
|
|
thresholdInObjects: 22
|
|
thresholdInEnums: 24
|
|
ignoreDeprecated: true
|
|
ignorePrivate: true
|
|
ignoreOverridden: true
|
|
|
|
LongMethod:
|
|
active: true
|
|
threshold: 75
|
|
ignoreAnnotated: [ ]
|
|
LongParameterList:
|
|
active: true
|
|
functionThreshold: 10
|
|
constructorThreshold: 8
|
|
ignoreDefaultParameters: false
|
|
ignoreDataClasses: true
|
|
ignoreAnnotated: [ ]
|
|
NamedArguments:
|
|
active: false
|
|
threshold: 3
|
|
NestedBlockDepth:
|
|
active: false
|
|
threshold: 4
|
|
ReplaceSafeCallChainWithRun:
|
|
active: false
|
|
|
|
coroutines:
|
|
active: true
|
|
GlobalCoroutineUsage:
|
|
active: true
|
|
RedundantSuspendModifier:
|
|
active: true
|
|
SleepInsteadOfDelay:
|
|
active: true
|
|
SuspendFunWithFlowReturnType:
|
|
active: true
|
|
empty-blocks:
|
|
active: true
|
|
EmptyCatchBlock:
|
|
active: true
|
|
allowedExceptionNameRegex: '_|(ignore|expected).*'
|
|
EmptyClassBlock:
|
|
active: true
|
|
EmptyDefaultConstructor:
|
|
active: true
|
|
EmptyDoWhileBlock:
|
|
active: true
|
|
EmptyElseBlock:
|
|
active: true
|
|
EmptyFinallyBlock:
|
|
active: true
|
|
EmptyForBlock:
|
|
active: true
|
|
EmptyFunctionBlock:
|
|
active: true
|
|
ignoreOverridden: false
|
|
EmptyIfBlock:
|
|
active: true
|
|
EmptyInitBlock:
|
|
active: true
|
|
EmptyKtFile:
|
|
active: true
|
|
EmptySecondaryConstructor:
|
|
active: true
|
|
EmptyTryBlock:
|
|
active: true
|
|
EmptyWhenBlock:
|
|
active: true
|
|
EmptyWhileBlock:
|
|
active: true
|
|
|
|
exceptions:
|
|
InstanceOfCheckForException:
|
|
active: true
|
|
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
|
|
NotImplementedDeclaration:
|
|
active: false
|
|
ObjectExtendsThrowable:
|
|
active: true
|
|
RethrowCaughtException:
|
|
active: true
|
|
ReturnFromFinally:
|
|
active: true
|
|
ThrowingExceptionFromFinally:
|
|
active: true
|
|
ThrowingExceptionInMain:
|
|
active: true
|
|
ThrowingExceptionsWithoutMessageOrCause:
|
|
active: true
|
|
excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**' ]
|
|
exceptions:
|
|
- 'ArrayIndexOutOfBoundsException'
|
|
- 'Error'
|
|
- 'Exception'
|
|
- 'IllegalMonitorStateException'
|
|
- 'NullPointerException'
|
|
- 'IndexOutOfBoundsException'
|
|
- 'RuntimeException'
|
|
- 'Throwable'
|
|
ThrowingNewInstanceOfSameException:
|
|
active: true
|
|
SwallowedException:
|
|
active: true
|
|
ignoredExceptionTypes:
|
|
- 'NumberFormatException'
|
|
- 'InterruptedException'
|
|
- 'ParseException'
|
|
- 'MalformedURLException'
|
|
- 'UnknownHostException'
|
|
allowedExceptionNameRegex: '_|(ignore|expected).*'
|
|
TooGenericExceptionCaught:
|
|
active: true
|
|
excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**' ]
|
|
exceptionNames:
|
|
- 'ArrayIndexOutOfBoundsException'
|
|
- 'Error'
|
|
- 'Exception'
|
|
- 'IllegalMonitorStateException'
|
|
- 'NullPointerException'
|
|
- 'IndexOutOfBoundsException'
|
|
- 'RuntimeException'
|
|
- 'Throwable'
|
|
allowedExceptionNameRegex: '_|(ignore|expected).*'
|
|
TooGenericExceptionThrown:
|
|
active: true
|
|
exceptionNames:
|
|
- 'Error'
|
|
- 'Exception'
|
|
- 'Throwable'
|
|
- 'RuntimeException'
|
|
|
|
naming:
|
|
ClassNaming:
|
|
excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**' ]
|
|
classPattern: '[A-Z][a-zA-Z0-9]*'
|
|
ConstructorParameterNaming:
|
|
active: true
|
|
excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**' ]
|
|
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/**' ]
|
|
enumEntryPattern: '[A-Z][_a-zA-Z0-9]*|`.*`'
|
|
ForbiddenClassName:
|
|
active: false
|
|
excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**' ]
|
|
forbiddenName: [ ]
|
|
FunctionNaming:
|
|
active: true
|
|
excludes:
|
|
- '**/test/**'
|
|
- '**/androidTest/**'
|
|
- '**/commonTest/**'
|
|
- '**/functionalTest/**'
|
|
- '**/jvmTest/**'
|
|
- '**/jsTest/**'
|
|
- '**/iosTest/**'
|
|
TopLevelPropertyNaming:
|
|
constantPattern: '[a-z][_A-Za-z0-9]*|[A-Z][_A-Z0-9]*'
|
|
InvalidPackageDeclaration:
|
|
active: true
|
|
excludes: ['**/build-logic/**/*.kt', '**/*.kts']
|
|
NoNameShadowing:
|
|
active: false
|
|
NonBooleanPropertyPrefixedWithIs:
|
|
active: true
|
|
VariableMaxLength:
|
|
active: true
|
|
VariableMinLength:
|
|
active: true
|
|
|
|
performance:
|
|
active: true
|
|
ArrayPrimitive:
|
|
active: true
|
|
ForEachOnRange:
|
|
active: true
|
|
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
|
|
SpreadOperator:
|
|
active: true
|
|
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
|
|
UnnecessaryTemporaryInstantiation:
|
|
active: true
|
|
|
|
potential-bugs:
|
|
active: true
|
|
AvoidReferentialEquality:
|
|
active: true
|
|
DontDowncastCollectionTypes:
|
|
active: true
|
|
DoubleMutabilityForCollection:
|
|
active: false
|
|
ElseCaseInsteadOfExhaustiveWhen:
|
|
active: true
|
|
ExitOutsideMain:
|
|
active: false
|
|
HasPlatformType:
|
|
active: true
|
|
IgnoredReturnValue:
|
|
active: true
|
|
restrictToConfig: true
|
|
returnValueAnnotations:
|
|
- '*.CheckReturnValue'
|
|
- '*.CheckResult'
|
|
ImplicitUnitReturnType:
|
|
active: true
|
|
MapGetWithNotNullAssertionOperator:
|
|
active: false
|
|
UnconditionalJumpStatementInLoop:
|
|
active: true
|
|
UnsafeCast:
|
|
active: true
|
|
excludes: ['**/test/**', '**/*.Test.kt', '**/*.Spec.kt']
|
|
UselessPostfixExpression:
|
|
active: true
|
|
CastToNullableType:
|
|
active: false
|
|
Deprecation:
|
|
active: false
|
|
style:
|
|
CanBeNonNullable:
|
|
active: false
|
|
CascadingCallWrapping:
|
|
active: true
|
|
ClassOrdering:
|
|
active: true
|
|
CollapsibleIfStatements:
|
|
active: true
|
|
DestructuringDeclarationWithTooManyEntries:
|
|
active: true
|
|
EqualsOnSignatureLine:
|
|
active: true
|
|
ExplicitCollectionElementAccessMethod:
|
|
active: true
|
|
ExplicitItLambdaParameter:
|
|
active: true
|
|
ForbiddenComment:
|
|
active: true
|
|
values:
|
|
- 'TODO:'
|
|
- 'FIXME:'
|
|
- 'STOPSHIP:'
|
|
- '@author'
|
|
- '@requiresTypeResolution'
|
|
excludes: ['**/detekt-rules-style/**/ForbiddenComment.kt']
|
|
ForbiddenImport:
|
|
active: true
|
|
imports:
|
|
- value: 'org.assertj.core.api.Assertions'
|
|
reason: 'Import Assertions.assertThat instead.'
|
|
- value: 'org.junit.jupiter.api.Assertions*'
|
|
reason: 'Use AssertJ assertions instead.'
|
|
ForbiddenMethodCall:
|
|
active: false
|
|
methods:
|
|
- 'kotlin.io.print'
|
|
- 'kotlin.io.println'
|
|
- 'java.net.URL.openStream'
|
|
- 'java.lang.Class.getResourceAsStream'
|
|
- 'java.lang.ClassLoader.getResourceAsStream'
|
|
- 'org.jetbrains.kotlin.diagnostics.DiagnosticUtils.getLineAndColumnInPsiFile'
|
|
|
|
ForbiddenVoid:
|
|
active: true
|
|
MagicNumber:
|
|
excludes: ['**/test/**', '**/*Test.kt', '**/*Spec.kt']
|
|
ignorePropertyDeclaration: true
|
|
ignoreAnnotation: true
|
|
ignoreEnums: true
|
|
ignoreNumbers:
|
|
- '-1'
|
|
- '0'
|
|
- '1'
|
|
- '2'
|
|
- '100'
|
|
- '1000'
|
|
MandatoryBracesLoops:
|
|
active: true
|
|
MaxLineLength:
|
|
active: true
|
|
excludes: ['**/test/**', '**/*Test.kt', '**/*Spec.kt']
|
|
excludeCommentStatements: true
|
|
NestedClassesVisibility:
|
|
active: true
|
|
ObjectLiteralToLambda:
|
|
active: true
|
|
PreferToOverPairSyntax:
|
|
active: true
|
|
RedundantExplicitType:
|
|
active: true
|
|
RedundantHigherOrderMapUsage:
|
|
active: true
|
|
RedundantVisibilityModifierRule:
|
|
active: true
|
|
ReturnCount:
|
|
active: true
|
|
excludeGuardClauses: true
|
|
SpacingBetweenPackageAndImports:
|
|
active: true
|
|
TrimMultilineRawString:
|
|
active: true
|
|
UnderscoresInNumericLiterals:
|
|
active: true
|
|
UnnecessaryAnnotationUseSiteTarget:
|
|
active: true
|
|
UnnecessaryFilter:
|
|
active: true
|
|
UnnecessaryLet:
|
|
active: true
|
|
UnnecessaryInnerClass:
|
|
active: true
|
|
ignoreAnnotated: ['Nested']
|
|
UntilInsteadOfRangeTo:
|
|
active: true
|
|
UnusedImports:
|
|
active: false # formatting already have this rule enabled
|
|
UnusedPrivateMember:
|
|
active: true
|
|
allowedNames: '(_|ignored|expected)'
|
|
UseAnyOrNoneInsteadOfFind:
|
|
active: true
|
|
UseCheckOrError:
|
|
active: true
|
|
UseEmptyCounterpart:
|
|
active: true
|
|
UseIfEmptyOrIfBlank:
|
|
active: true
|
|
UseIsNullOrEmpty:
|
|
active: true
|
|
UseOrEmpty:
|
|
active: true
|
|
UseRequire:
|
|
active: true
|
|
UseRequireNotNull:
|
|
active: true
|
|
VarCouldBeVal:
|
|
active: true
|
|
ignoreAnnotated: ['Parameter']
|
|
formatting:
|
|
active: true
|
|
android: false
|
|
autoCorrect: true
|
|
AnnotationOnSeparateLine:
|
|
active: false
|
|
autoCorrect: true
|
|
AnnotationSpacing:
|
|
active: false
|
|
autoCorrect: true
|
|
ArgumentListWrapping:
|
|
active: false
|
|
autoCorrect: true
|
|
indentSize: 4
|
|
maxLineLength: 120
|
|
ChainWrapping:
|
|
active: true
|
|
autoCorrect: true
|
|
CommentSpacing:
|
|
active: true
|
|
autoCorrect: true
|
|
EnumEntryNameCase:
|
|
active: false
|
|
autoCorrect: true
|
|
Filename:
|
|
active: false
|
|
FunctionReturnTypeSpacing:
|
|
active: true
|
|
FunctionStartOfBodySpacing:
|
|
active: true
|
|
FinalNewline:
|
|
active: true
|
|
autoCorrect: true
|
|
insertFinalNewLine: true
|
|
ImportOrdering:
|
|
active: false
|
|
autoCorrect: true
|
|
layout: '*,java.**,javax.**,kotlin.**,^'
|
|
Indentation:
|
|
active: false
|
|
autoCorrect: true
|
|
indentSize: 4
|
|
MaximumLineLength:
|
|
active: true
|
|
maxLineLength: 120
|
|
ignoreBackTickedIdentifier: false
|
|
NullableTypeSpacing:
|
|
active: true
|
|
ParameterListSpacing:
|
|
active: true
|
|
SpacingBetweenFunctionNameAndOpeningParenthesis:
|
|
active: true
|
|
TypeParameterListSpacing:
|
|
active: true
|
|
ModifierOrdering:
|
|
active: true
|
|
autoCorrect: true
|
|
MultiLineIfElse:
|
|
active: true
|
|
autoCorrect: true
|
|
NoBlankLineBeforeRbrace:
|
|
active: true
|
|
autoCorrect: true
|
|
NoConsecutiveBlankLines:
|
|
active: true
|
|
autoCorrect: true
|
|
NoEmptyClassBody:
|
|
active: true
|
|
autoCorrect: true
|
|
NoEmptyFirstLineInMethodBlock:
|
|
active: false
|
|
autoCorrect: true
|
|
NoLineBreakAfterElse:
|
|
active: true
|
|
autoCorrect: true
|
|
NoLineBreakBeforeAssignment:
|
|
active: true
|
|
autoCorrect: true
|
|
NoMultipleSpaces:
|
|
active: true
|
|
autoCorrect: true
|
|
NoSemicolons:
|
|
active: true
|
|
autoCorrect: true
|
|
NoTrailingSpaces:
|
|
active: true
|
|
autoCorrect: true
|
|
NoUnitReturn:
|
|
active: true
|
|
autoCorrect: true
|
|
NoUnusedImports:
|
|
active: true
|
|
autoCorrect: true
|
|
WildcardImport:
|
|
active: true
|
|
excludeImports: []
|
|
PackageName:
|
|
active: true
|
|
autoCorrect: true
|
|
ParameterListWrapping:
|
|
active: true
|
|
autoCorrect: true
|
|
maxLineLength: 120
|
|
SpacingAroundAngleBrackets:
|
|
active: false
|
|
autoCorrect: true
|
|
SpacingAroundColon:
|
|
active: true
|
|
autoCorrect: true
|
|
SpacingAroundComma:
|
|
active: true
|
|
autoCorrect: true
|
|
SpacingAroundCurly:
|
|
active: true
|
|
autoCorrect: true
|
|
SpacingAroundDot:
|
|
active: true
|
|
autoCorrect: true
|
|
SpacingAroundDoubleColon:
|
|
active: false
|
|
autoCorrect: true
|
|
SpacingAroundKeyword:
|
|
active: true
|
|
autoCorrect: true
|
|
SpacingAroundOperators:
|
|
active: true
|
|
autoCorrect: true
|
|
SpacingAroundParens:
|
|
active: true
|
|
autoCorrect: true
|
|
SpacingAroundRangeOperator:
|
|
active: true
|
|
autoCorrect: true
|
|
SpacingAroundUnaryOperator:
|
|
active: false
|
|
autoCorrect: true
|
|
SpacingBetweenDeclarationsWithAnnotations:
|
|
active: false
|
|
autoCorrect: true
|
|
SpacingBetweenDeclarationsWithComments:
|
|
active: false
|
|
autoCorrect: true
|
|
StringTemplate:
|
|
active: true
|
|
autoCorrect: true
|
|
TrailingCommaOnCallSite:
|
|
active: false
|
|
autoCorrect: true
|
|
useTrailingCommaOnCallSite: false
|
|
TrailingCommaOnDeclarationSite:
|
|
active: false
|
|
autoCorrect: true
|
|
useTrailingCommaOnDeclarationSite: false
|