diff --git a/detekt.yml b/detekt.yml index bb10113..8b133ec 100644 --- a/detekt.yml +++ b/detekt.yml @@ -34,7 +34,7 @@ processors: console-reports: active: true exclude: - - '' # Exclude nothing -> Enable all workaround + - '' # Exclude nothing -> Enable all output-reports: active: true @@ -43,6 +43,7 @@ output-reports: # - 'XmlOutputReport' # - 'HtmlOutputReport' # - 'MdOutputReport' + # - 'SarifOutputReport' comments: active: true @@ -61,7 +62,7 @@ comments: endOfSentenceFormat: '([.?!][ \t\n\r\f<])|([.?!:]$)' KDocReferencesNonPublicProperty: active: false - excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**' ] + excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ] OutdatedDocumentation: active: false matchTypeParameters: true @@ -69,7 +70,7 @@ comments: allowParamOnConstructorProperties: false UndocumentedPublicClass: active: false - excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**' ] + excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ] searchInNestedClass: true searchInInnerClass: true searchInInnerObject: true @@ -77,11 +78,11 @@ comments: searchInProtectedClass: false UndocumentedPublicFunction: active: false - excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**' ] + excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ] searchProtectedFunction: false UndocumentedPublicProperty: active: false - excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**' ] + excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ] searchProtectedProperty: false complexity: @@ -153,14 +154,14 @@ complexity: active: false StringLiteralDuplication: active: false - excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**' ] + excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ] threshold: 3 ignoreAnnotation: true excludeStringsWithLessThan5Characters: true ignoreStringsRegex: '$^' TooManyFunctions: active: true - excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**' ] + excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ] thresholdInFiles: 11 thresholdInClasses: 11 thresholdInInterfaces: 11 @@ -169,6 +170,7 @@ complexity: ignoreDeprecated: false ignorePrivate: false ignoreOverridden: false + ignoreAnnotatedFunctions: [ ] coroutines: active: true @@ -184,6 +186,8 @@ coroutines: active: true SleepInsteadOfDelay: active: true + SuspendFunSwallowedCancellation: + active: false SuspendFunWithCoroutineScopeReceiver: active: false SuspendFunWithFlowReturnType: @@ -235,7 +239,7 @@ exceptions: - 'toString' InstanceOfCheckForException: active: true - excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**' ] + excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ] NotImplementedDeclaration: active: false ObjectExtendsThrowable: @@ -261,7 +265,7 @@ exceptions: active: false ThrowingExceptionsWithoutMessageOrCause: active: true - excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**' ] + excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ] exceptions: - 'ArrayIndexOutOfBoundsException' - 'Exception' @@ -276,7 +280,7 @@ exceptions: active: true TooGenericExceptionCaught: active: true - excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**' ] + excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ] exceptionNames: - 'ArrayIndexOutOfBoundsException' - 'Error' @@ -300,7 +304,6 @@ naming: BooleanPropertyNaming: active: false allowedPattern: '^(is|has|are)' - ignoreOverridden: true ClassNaming: active: true classPattern: '[A-Z][a-zA-Z0-9]*' @@ -309,7 +312,6 @@ naming: parameterPattern: '[a-z][A-Za-z0-9]*' privateParameterPattern: '[a-z][A-Za-z0-9]*' excludeClassPattern: '$^' - ignoreOverridden: true EnumNaming: active: true enumEntryPattern: '[A-Z][_a-zA-Z0-9]*' @@ -324,15 +326,13 @@ naming: minimumFunctionNameLength: 3 FunctionNaming: active: true - excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**' ] + excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ] functionPattern: '[a-z][a-zA-Z0-9]*' excludeClassPattern: '$^' - ignoreOverridden: true FunctionParameterNaming: active: true parameterPattern: '[a-z][A-Za-z0-9]*' excludeClassPattern: '$^' - ignoreOverridden: true InvalidPackageDeclaration: active: true rootPackage: '' @@ -374,7 +374,6 @@ naming: variablePattern: '[a-z][A-Za-z0-9]*' privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*' excludeClassPattern: '$^' - ignoreOverridden: true performance: active: true @@ -385,10 +384,10 @@ performance: threshold: 3 ForEachOnRange: active: true - excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**' ] + excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ] SpreadOperator: active: true - excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**' ] + excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ] UnnecessaryPartOfBinaryExpression: active: false UnnecessaryTemporaryInstantiation: @@ -400,6 +399,8 @@ potential-bugs: active: true forbiddenTypePatterns: - 'kotlin.String' + CastNullableToNonNullableType: + active: false CastToNullableType: active: false Deprecation: @@ -419,6 +420,7 @@ potential-bugs: - 'java.util.HashMap' ElseCaseInsteadOfExhaustiveWhen: active: false + ignoredSubjectTypes: [ ] EqualsAlwaysReturnsTrueOrFalse: active: true EqualsWithHashCodeExist: @@ -433,9 +435,12 @@ potential-bugs: active: true restrictToConfig: true returnValueAnnotations: + - 'CheckResult' - '*.CheckResult' + - 'CheckReturnValue' - '*.CheckReturnValue' ignoreReturnValueAnnotations: + - 'CanIgnoreReturnValue' - '*.CanIgnoreReturnValue' returnValueTypes: - 'kotlin.sequences.Sequence' @@ -455,7 +460,7 @@ potential-bugs: active: true LateinitUsage: active: false - excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**' ] + excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ] ignoreOnClassesPattern: '' MapGetWithNotNullAssertionOperator: active: true @@ -466,6 +471,8 @@ potential-bugs: active: false NullableToStringCall: active: false + PropertyUsedBeforeDeclaration: + active: false UnconditionalJumpStatementInLoop: active: false UnnecessaryNotNullCheck: @@ -480,7 +487,7 @@ potential-bugs: active: true UnsafeCallOnNullableType: active: true - excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**' ] + excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ] UnsafeCast: active: true UnusedUnaryOperator: @@ -494,6 +501,14 @@ style: active: true AlsoCouldBeApply: active: false + BracesOnIfStatements: + active: false + singleLine: 'never' + multiLine: 'always' + BracesOnWhenStatements: + active: false + singleLine: 'necessary' + multiLine: 'consistent' CanBeNonNullable: active: false CascadingCallWrapping: @@ -507,11 +522,22 @@ style: active: false conversionFunctionPrefix: - 'to' + allowOperators: false DataClassShouldBeImmutable: active: false DestructuringDeclarationWithTooManyEntries: active: true maxDestructuringEntries: 3 + DoubleNegativeLambda: + active: false + negativeFunctions: + - reason: 'Use `takeIf` instead.' + value: 'takeUnless' + - reason: 'Use `all` instead.' + value: 'none' + negativeFunctionNameParts: + - 'not' + - 'non' EqualsNullCall: active: true EqualsOnSignatureLine: @@ -523,14 +549,33 @@ style: ExpressionBodySyntax: active: false includeLineWrapping: false + ForbiddenAnnotation: + active: false + annotations: + - reason: 'it is a java annotation. Use `Suppress` instead.' + value: 'java.lang.SuppressWarnings' + - reason: 'it is a java annotation. Use `kotlin.Deprecated` instead.' + value: 'java.lang.Deprecated' + - reason: 'it is a java annotation. Use `kotlin.annotation.MustBeDocumented` instead.' + value: 'java.lang.annotation.Documented' + - reason: 'it is a java annotation. Use `kotlin.annotation.Target` instead.' + value: 'java.lang.annotation.Target' + - reason: 'it is a java annotation. Use `kotlin.annotation.Retention` instead.' + value: 'java.lang.annotation.Retention' + - reason: 'it is a java annotation. Use `kotlin.annotation.Repeatable` instead.' + value: 'java.lang.annotation.Repeatable' + - reason: 'Kotlin does not support @Inherited annotation, see https://youtrack.jetbrains.com/issue/KT-22265' + value: 'java.lang.annotation.Inherited' ForbiddenComment: active: true - values: - - 'FIXME:' - - 'STOPSHIP:' - - 'TODO:' + 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:' + - reason: 'Forbidden TODO todo marker in comment, please do the changes.' + value: 'TODO:' allowedPatterns: 'https://github.com/mrclrchtr/gradle-kotlin-spring/issues/\d+' - customMessage: '' ForbiddenImport: active: false imports: [ ] @@ -559,7 +604,7 @@ style: maxJumpCount: 1 MagicNumber: active: true - excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**', '**/*.kts' ] + excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**', '**/*.kts' ] ignoreNumbers: - '-1' - '0' @@ -575,8 +620,6 @@ style: ignoreEnums: false ignoreRanges: false ignoreExtensionFunctions: true - MandatoryBracesIfStatements: - active: false MandatoryBracesLoops: active: false MaxChainedCallsOnSameLine: @@ -598,6 +641,9 @@ style: MultilineRawStringIndentation: active: false indentSize: 4 + trimmingMethods: + - 'trimIndent' + - 'trimMargin' NestedClassesVisibility: active: true NewLineAtEndOfFile: @@ -612,8 +658,6 @@ style: active: true OptionalUnit: active: false - OptionalWhenBraces: - active: false PreferToOverPairSyntax: active: false ProtectedMemberInFinalClass: @@ -638,6 +682,10 @@ style: active: true SpacingBetweenPackageAndImports: active: false + StringShouldBeRawString: + active: false + maxEscapedCharacterCount: 2 + ignoredCharacters: [ ] ThrowsCount: active: true max: 2 @@ -646,6 +694,9 @@ style: active: false TrimMultilineRawString: active: false + trimmingMethods: + - 'trimIndent' + - 'trimMargin' UnderscoresInNumericLiterals: active: false acceptableLength: 4 @@ -658,6 +709,8 @@ style: active: true UnnecessaryBackticks: active: false + UnnecessaryBracesAroundTrailingLambda: + active: false UnnecessaryFilter: active: true UnnecessaryInheritance: @@ -673,11 +726,17 @@ style: active: false UnusedImports: active: false + UnusedParameter: + active: true + allowedNames: 'ignored|expected' UnusedPrivateClass: active: true UnusedPrivateMember: active: true - allowedNames: '(_|ignored|expected|serialVersionUID)' + allowedNames: '' + UnusedPrivateProperty: + active: true + allowedNames: '_|ignored|expected|serialVersionUID' UseAnyOrNoneInsteadOfFind: active: true UseArrayLiteralsInAnnotations: @@ -695,8 +754,11 @@ style: active: false UseIfInsteadOfWhen: active: false + ignoreWhenContainingVariableDeclaration: false UseIsNullOrEmpty: active: true + UseLet: + active: false UseOrEmpty: active: true UseRequire: @@ -724,6 +786,7 @@ formatting: AnnotationOnSeparateLine: active: true autoCorrect: true + indentSize: 4 AnnotationSpacing: active: true autoCorrect: true @@ -733,17 +796,25 @@ formatting: indentSize: 4 maxLineLength: 120 BlockCommentInitialStarAlignment: - active: false + active: true autoCorrect: true ChainWrapping: active: true autoCorrect: true + indentSize: 4 + ClassName: + active: false CommentSpacing: active: true autoCorrect: true CommentWrapping: + active: true + autoCorrect: true + indentSize: 4 + ContextReceiverMapping: active: false autoCorrect: true + maxLineLength: 120 indentSize: 4 DiscouragedCommentLocation: active: false @@ -751,6 +822,10 @@ formatting: EnumEntryNameCase: active: true autoCorrect: true + EnumWrapping: + active: false + autoCorrect: true + indentSize: 4 Filename: active: true FinalNewline: @@ -758,11 +833,14 @@ formatting: autoCorrect: true insertFinalNewLine: true FunKeywordSpacing: - active: false + active: true autoCorrect: true - FunctionReturnTypeSpacing: + FunctionName: active: false + FunctionReturnTypeSpacing: + active: true autoCorrect: true + maxLineLength: 120 FunctionSignature: active: false autoCorrect: true @@ -771,11 +849,19 @@ formatting: maxLineLength: 120 indentSize: 4 FunctionStartOfBodySpacing: - active: false + active: true autoCorrect: true FunctionTypeReferenceSpacing: + active: true + autoCorrect: true + IfElseBracing: active: false autoCorrect: true + indentSize: 4 + IfElseWrapping: + active: false + autoCorrect: true + indentSize: 4 ImportOrdering: active: true autoCorrect: true @@ -785,7 +871,7 @@ formatting: autoCorrect: true indentSize: 4 KdocWrapping: - active: false + active: true autoCorrect: true indentSize: 4 MaximumLineLength: @@ -793,7 +879,7 @@ formatting: maxLineLength: 120 ignoreBackTickedIdentifier: false ModifierListSpacing: - active: false + active: true autoCorrect: true ModifierOrdering: active: true @@ -801,18 +887,32 @@ formatting: MultiLineIfElse: active: true autoCorrect: true + indentSize: 4 + MultilineExpressionWrapping: + active: false + autoCorrect: true + indentSize: 4 NoBlankLineBeforeRbrace: active: true autoCorrect: true + NoBlankLineInList: + active: false + autoCorrect: true NoBlankLinesInChainedMethodCalls: active: true autoCorrect: true NoConsecutiveBlankLines: active: true autoCorrect: true + NoConsecutiveComments: + active: false NoEmptyClassBody: active: true autoCorrect: true + NoEmptyFirstLineInClassBody: + active: false + autoCorrect: true + indentSize: 4 NoEmptyFirstLineInMethodBlock: active: true autoCorrect: true @@ -828,6 +928,10 @@ formatting: NoSemicolons: active: true autoCorrect: true + NoSingleLineBlockComment: + active: false + autoCorrect: true + indentSize: 4 NoTrailingSpaces: active: true autoCorrect: true @@ -841,7 +945,7 @@ formatting: active: true packagesToUseImportOnDemandProperty: 'java.util.*,kotlinx.android.synthetic.**' NullableTypeSpacing: - active: false + active: true autoCorrect: true PackageName: active: true @@ -853,6 +957,19 @@ formatting: active: true autoCorrect: true maxLineLength: 120 + indentSize: 4 + ParameterWrapping: + active: true + autoCorrect: true + indentSize: 4 + maxLineLength: 120 + PropertyName: + active: false + PropertyWrapping: + active: true + autoCorrect: true + indentSize: 4 + maxLineLength: 120 SpacingAroundAngleBrackets: active: true autoCorrect: true @@ -893,11 +1010,15 @@ formatting: active: true autoCorrect: true SpacingBetweenFunctionNameAndOpeningParenthesis: - active: false + active: true autoCorrect: true StringTemplate: active: true autoCorrect: true + StringTemplateIndent: + active: false + autoCorrect: true + indentSize: 4 TrailingCommaOnCallSite: active: false autoCorrect: true @@ -906,16 +1027,23 @@ formatting: active: false autoCorrect: true useTrailingCommaOnDeclarationSite: true + TryCatchFinallySpacing: + active: false + autoCorrect: true + indentSize: 4 TypeArgumentListSpacing: active: false autoCorrect: true + indentSize: 4 TypeParameterListSpacing: active: false autoCorrect: true + indentSize: 4 UnnecessaryParenthesesBeforeTrailingLambda: - active: false + active: true autoCorrect: true Wrapping: active: true autoCorrect: true indentSize: 4 + maxLineLength: 120