From d71598fe436c4b7c3a2e1fa5d2951a9ecdd207cc Mon Sep 17 00:00:00 2001 From: Ian Brandt Date: Wed, 11 Sep 2024 16:31:48 -0700 Subject: [PATCH] Implemented a custom Detekt rule for JUnit 5 `@TestFactory` functions that don't have a valid return type. Improved Detekt configuration. --- build-logic/settings.gradle.kts | 1 + ...otlin.buildlogic.detekt-project.gradle.kts | 27 + ...otlin.buildlogic.kotlin-project.gradle.kts | 3 +- config/detekt/detekt.yml | 768 +----------------- detekt-rules/build.gradle.kts | 28 + detekt-rules/settings.gradle.kts | 23 + .../junit/InvalidTestFactoryReturnType.kt | 98 +++ .../detekt/junit/JUnitRuleSetProvider.kt | 18 + ...tlab.arturbosch.detekt.api.RuleSetProvider | 1 + .../src/main/resources/config/config.yml | 3 + .../junit/InvalidTestFactoryReturnTypeTest.kt | 213 +++++ gradle/libs.versions.toml | 8 + .../effective-kotlin/detekt-baseline.xml | 27 - subprojects/kotlin-dl/detekt-baseline.xml | 8 - .../detekt-baseline.xml | 10 - .../kotlin-for-java-devs/detekt-baseline.xml | 281 ------- .../processor/detekt-baseline.xml | 8 - subprojects/tdd-in-kotlin/detekt-baseline.xml | 12 - .../detekt-baseline.xml | 12 - 19 files changed, 432 insertions(+), 1117 deletions(-) create mode 100644 build-logic/src/main/kotlin/org.sdkotlin.buildlogic.detekt-project.gradle.kts create mode 100644 detekt-rules/build.gradle.kts create mode 100644 detekt-rules/settings.gradle.kts create mode 100644 detekt-rules/src/main/kotlin/org/sdkotlin/detekt/junit/InvalidTestFactoryReturnType.kt create mode 100644 detekt-rules/src/main/kotlin/org/sdkotlin/detekt/junit/JUnitRuleSetProvider.kt create mode 100644 detekt-rules/src/main/resources/META-INF/services/io.gitlab.arturbosch.detekt.api.RuleSetProvider create mode 100644 detekt-rules/src/main/resources/config/config.yml create mode 100644 detekt-rules/src/test/kotlin/org/sdkotlin/detekt/junit/InvalidTestFactoryReturnTypeTest.kt delete mode 100644 subprojects/effective-kotlin/detekt-baseline.xml delete mode 100644 subprojects/kotlin-dl/detekt-baseline.xml delete mode 100644 subprojects/kotlin-for-java-devs-client/detekt-baseline.xml delete mode 100644 subprojects/kotlin-for-java-devs/detekt-baseline.xml delete mode 100644 subprojects/ksp-builder-generator/processor/detekt-baseline.xml delete mode 100644 subprojects/tdd-in-kotlin/detekt-baseline.xml delete mode 100644 subprojects/typed-errors-in-kotlin/detekt-baseline.xml diff --git a/build-logic/settings.gradle.kts b/build-logic/settings.gradle.kts index 1ae7dba..8fb5a18 100644 --- a/build-logic/settings.gradle.kts +++ b/build-logic/settings.gradle.kts @@ -19,5 +19,6 @@ dependencyResolutionManagement { } includeBuild("../platforms") +includeBuild("../detekt-rules") rootProject.name = "build-logic" diff --git a/build-logic/src/main/kotlin/org.sdkotlin.buildlogic.detekt-project.gradle.kts b/build-logic/src/main/kotlin/org.sdkotlin.buildlogic.detekt-project.gradle.kts new file mode 100644 index 0000000..60b8cd0 --- /dev/null +++ b/build-logic/src/main/kotlin/org.sdkotlin.buildlogic.detekt-project.gradle.kts @@ -0,0 +1,27 @@ +plugins { + kotlin("jvm") + // Version catalog type-safe accessors and extension not yet available in + // plugins block of precompiled script plugins: + // https://github.com/gradle/gradle/issues/15383 + // alias(libs.plugins.detekt.gradle.plugin) + id("io.gitlab.arturbosch.detekt") +} + +dependencies { + + detektPlugins("org.sdkotlin.detekt:detekt-rules:1.0-SNAPSHOT") +} + +tasks { + named("check").configure { + this.setDependsOn(this.dependsOn.filterNot { + it is TaskProvider<*> && it.name == "detekt" + }) + + val detektMain by existing + dependsOn(detektMain) + + val detektTest by existing + dependsOn(detektTest) + } +} diff --git a/build-logic/src/main/kotlin/org.sdkotlin.buildlogic.kotlin-project.gradle.kts b/build-logic/src/main/kotlin/org.sdkotlin.buildlogic.kotlin-project.gradle.kts index 9e159d5..8870e8f 100644 --- a/build-logic/src/main/kotlin/org.sdkotlin.buildlogic.kotlin-project.gradle.kts +++ b/build-logic/src/main/kotlin/org.sdkotlin.buildlogic.kotlin-project.gradle.kts @@ -7,10 +7,9 @@ plugins { // https://github.com/gradle/gradle/issues/15383 // alias(libs.plugins.dependency.analysis.gradle.plugin) id("com.autonomousapps.dependency-analysis") - // alias(libs.plugins.detekt.gradle.plugin) - id("io.gitlab.arturbosch.detekt") // alias(libs.plugins.jvm.dependency.conflict.detection.gradle.plugin) id("org.gradlex.jvm-dependency-conflict-detection") + id("org.sdkotlin.buildlogic.detekt-project") } val javaTargetVersion: String = JavaVersion.VERSION_21.toString() diff --git a/config/detekt/detekt.yml b/config/detekt/detekt.yml index bf3ea46..09afac7 100644 --- a/config/detekt/detekt.yml +++ b/config/detekt/detekt.yml @@ -1,35 +1,19 @@ build: maxIssues: 0 excludeCorrectable: false - weights: - # complexity: 2 - # LongParameterList: 1 - # style: 1 - # comments: 1 config: validation: true - warningsAsErrors: false + warningsAsErrors: true checkExhaustiveness: false - # when writing own rules with new properties, exclude the property path e.g.: 'my_rule_set,.*>.*>[my_property]' + # when writing own rules with new properties, + # exclude the property path e.g.: 'my_rule_set,.*>.*>[my_property]' excludes: '' processors: active: true exclude: - 'DetektProgressListener' - # - 'KtFileCountProcessor' - # - 'PackageCountProcessor' - # - 'ClassCountProcessor' - # - 'FunctionCountProcessor' - # - 'PropertyCountProcessor' - # - 'ProjectComplexityProcessor' - # - 'ProjectCognitiveComplexityProcessor' - # - 'ProjectLLOCProcessor' - # - 'ProjectCLOCProcessor' - # - 'ProjectLOCProcessor' - # - 'ProjectSLOCProcessor' - # - 'LicenseHeaderLoaderExtension' console-reports: active: true @@ -37,749 +21,19 @@ console-reports: - 'ProjectStatisticsReport' - 'ComplexityReport' - 'NotificationReport' - - 'FindingsReport' + #- 'FindingsReport' - 'FileBasedFindingsReport' - # - 'LiteFindingsReport' output-reports: active: true exclude: - # - 'TxtOutputReport' - # - 'XmlOutputReport' - # - 'HtmlOutputReport' - # - 'MdOutputReport' - # - 'SarifOutputReport' + - 'HtmlOutputReport' + - 'TxtOutputReport' + - 'XmlOutputReport' + - 'SarifOutputReport' + #- 'MdOutputReport' -comments: +junit: 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<])|([.?!:]$)' - KDocReferencesNonPublicProperty: - active: false - excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ] - OutdatedDocumentation: - active: false - matchTypeParameters: true - matchDeclarationsOrder: true - allowParamOnConstructorProperties: false - UndocumentedPublicClass: - active: false - excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ] - searchInNestedClass: true - searchInInnerClass: true - searchInInnerObject: true - searchInInnerInterface: true - searchInProtectedClass: false - UndocumentedPublicFunction: - active: false - excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ] - searchProtectedFunction: false - UndocumentedPublicProperty: - active: false - excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ] - searchProtectedProperty: false - -complexity: - active: true - CognitiveComplexMethod: - active: false - threshold: 15 - ComplexCondition: - active: true - threshold: 4 - ComplexInterface: - active: false - threshold: 10 - includeStaticDeclarations: false - includePrivateDeclarations: false - ignoreOverloaded: false - CyclomaticComplexMethod: - active: true - threshold: 15 - ignoreSingleWhenExpression: false - ignoreSimpleWhenEntries: false - ignoreNestingFunctions: false - nestingFunctions: - - 'also' - - 'apply' - - 'forEach' - - 'isNotNull' - - 'ifNull' - - 'let' - - 'run' - - 'use' - - 'with' - LabeledExpression: - active: false - ignoredLabels: [ ] - LargeClass: - active: true - threshold: 600 - LongMethod: - active: true - threshold: 60 - LongParameterList: - active: true - functionThreshold: 6 - constructorThreshold: 7 - ignoreDefaultParameters: false - ignoreDataClasses: true - ignoreAnnotatedParameter: [ ] - MethodOverloading: - active: false - threshold: 6 - NamedArguments: - active: false - threshold: 3 - ignoreArgumentsMatchingNames: false - NestedBlockDepth: - active: true - threshold: 4 - NestedScopeFunctions: - active: false - threshold: 1 - functions: - - 'kotlin.apply' - - 'kotlin.run' - - 'kotlin.with' - - 'kotlin.let' - - 'kotlin.also' - ReplaceSafeCallChainWithRun: - active: false - StringLiteralDuplication: - active: false - excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ] - threshold: 3 - ignoreAnnotation: true - excludeStringsWithLessThan5Characters: true - ignoreStringsRegex: '$^' - TooManyFunctions: - active: true - excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ] - thresholdInFiles: 11 - thresholdInClasses: 11 - thresholdInInterfaces: 11 - thresholdInObjects: 11 - thresholdInEnums: 11 - ignoreDeprecated: false - ignorePrivate: false - ignoreOverridden: false - ignoreAnnotatedFunctions: [ ] - -coroutines: - active: true - GlobalCoroutineUsage: - active: false - InjectDispatcher: - active: true - dispatcherNames: - - 'IO' - - 'Default' - - 'Unconfined' - RedundantSuspendModifier: - active: true - SleepInsteadOfDelay: - active: true - SuspendFunSwallowedCancellation: - active: false - SuspendFunWithCoroutineScopeReceiver: - active: false - 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: - active: true - ExceptionRaisedInUnexpectedLocation: - active: true - methodNames: - - 'equals' - - 'finalize' - - 'hashCode' - - 'toString' - InstanceOfCheckForException: - active: true - excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ] - NotImplementedDeclaration: - active: false - ObjectExtendsThrowable: - active: false - PrintStackTrace: - active: true - RethrowCaughtException: - active: true - ReturnFromFinally: - active: true - ignoreLabeled: false - SwallowedException: - active: true - ignoredExceptionTypes: - - 'InterruptedException' - - 'MalformedURLException' - - 'NumberFormatException' - - 'ParseException' - allowedExceptionNameRegex: '_|(ignore|expected).*' - ThrowingExceptionFromFinally: - active: true - ThrowingExceptionInMain: - active: false - ThrowingExceptionsWithoutMessageOrCause: - active: true - excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ] - exceptions: - - 'ArrayIndexOutOfBoundsException' - - 'Exception' - - 'IllegalArgumentException' - - 'IllegalMonitorStateException' - - 'IllegalStateException' - - 'IndexOutOfBoundsException' - - 'NullPointerException' - - 'RuntimeException' - - 'Throwable' - ThrowingNewInstanceOfSameException: - active: true - TooGenericExceptionCaught: - active: true - excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ] - exceptionNames: - - 'ArrayIndexOutOfBoundsException' - - 'Error' - - 'Exception' - - 'IllegalMonitorStateException' - - 'IndexOutOfBoundsException' - - 'NullPointerException' - - 'RuntimeException' - - 'Throwable' - allowedExceptionNameRegex: '_|(ignore|expected).*' - TooGenericExceptionThrown: - active: true - exceptionNames: - - 'Error' - - 'Exception' - - 'RuntimeException' - - 'Throwable' - -naming: - active: true - BooleanPropertyNaming: - active: false - allowedPattern: '^(is|has|are)' - ClassNaming: - active: true - classPattern: '[A-Z][a-zA-Z0-9]*' - ConstructorParameterNaming: - active: true - parameterPattern: '[a-z][A-Za-z0-9]*' - privateParameterPattern: '[a-z][A-Za-z0-9]*' - excludeClassPattern: '$^' - EnumNaming: - active: true - enumEntryPattern: '[A-Z][_a-zA-Z0-9]*' - ForbiddenClassName: - active: false - forbiddenName: [ ] - FunctionMaxLength: - active: false - maximumFunctionNameLength: 30 - FunctionMinLength: - active: false - minimumFunctionNameLength: 3 - FunctionNaming: - active: true - excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ] - functionPattern: '[a-z][a-zA-Z0-9]*' - excludeClassPattern: '$^' - FunctionParameterNaming: - active: true - parameterPattern: '[a-z][A-Za-z0-9]*' - excludeClassPattern: '$^' - InvalidPackageDeclaration: - active: true - rootPackage: '' - requireRootInDeclaration: false - LambdaParameterNaming: - active: false - parameterPattern: '[a-z][A-Za-z0-9]*|_' - MatchingDeclarationName: - active: true - mustBeFirst: true - MemberNameEqualsClassName: - active: true - ignoreOverridden: true - NoNameShadowing: - active: true - NonBooleanPropertyPrefixedWithIs: - active: false - ObjectPropertyNaming: - active: true - 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 - packagePattern: '[a-z]+(\.[a-z][A-Za-z0-9]*)*' - TopLevelPropertyNaming: - active: true - 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 - maximumVariableNameLength: 64 - VariableMinLength: - active: false - minimumVariableNameLength: 1 - VariableNaming: - active: true - variablePattern: '[a-z][A-Za-z0-9]*' - privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*' - excludeClassPattern: '$^' - -performance: - active: true - ArrayPrimitive: - active: true - CouldBeSequence: - active: false - threshold: 3 - ForEachOnRange: - active: true - excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ] - SpreadOperator: - active: true - excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ] - UnnecessaryPartOfBinaryExpression: - active: false - UnnecessaryTemporaryInstantiation: - active: true - -potential-bugs: - active: true - AvoidReferentialEquality: - active: true - forbiddenTypePatterns: - - 'kotlin.String' - CastNullableToNonNullableType: - active: false - CastToNullableType: - active: false - Deprecation: - active: false - DontDowncastCollectionTypes: - active: false - DoubleMutabilityForCollection: - active: true - mutableTypes: - - 'kotlin.collections.MutableList' - - 'kotlin.collections.MutableMap' - - 'kotlin.collections.MutableSet' - - 'java.util.ArrayList' - - 'java.util.LinkedHashSet' - - 'java.util.HashSet' - - 'java.util.LinkedHashMap' - - 'java.util.HashMap' - ElseCaseInsteadOfExhaustiveWhen: - active: false - ignoredSubjectTypes: [ ] - EqualsAlwaysReturnsTrueOrFalse: - active: true - EqualsWithHashCodeExist: - active: true - ExitOutsideMain: - active: false - ExplicitGarbageCollectionCall: - active: true - HasPlatformType: - active: true - IgnoredReturnValue: - active: true - restrictToConfig: true - returnValueAnnotations: - - 'CheckResult' - - '*.CheckResult' - - 'CheckReturnValue' - - '*.CheckReturnValue' - ignoreReturnValueAnnotations: - - 'CanIgnoreReturnValue' - - '*.CanIgnoreReturnValue' - returnValueTypes: - - 'kotlin.sequences.Sequence' - - 'kotlinx.coroutines.flow.*Flow' - - 'java.util.stream.*Stream' - ignoreFunctionCall: [ ] - ImplicitDefaultLocale: - active: true - ImplicitUnitReturnType: - active: false - allowExplicitReturnType: true - InvalidRange: - active: true - IteratorHasNextCallsNextMethod: - active: true - IteratorNotThrowingNoSuchElementException: - active: true - LateinitUsage: - active: false - excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ] - ignoreOnClassesPattern: '' - MapGetWithNotNullAssertionOperator: - active: true - MissingPackageDeclaration: - active: false - excludes: [ '**/*.kts' ] - NullCheckOnMutableProperty: - active: false - NullableToStringCall: - active: false - PropertyUsedBeforeDeclaration: - active: false - UnconditionalJumpStatementInLoop: - active: false - UnnecessaryNotNullCheck: - active: false - UnnecessaryNotNullOperator: - active: true - UnnecessarySafeCall: - active: true - UnreachableCatchBlock: - active: true - UnreachableCode: - active: true - UnsafeCallOnNullableType: - active: true - excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**' ] - UnsafeCast: - active: true - UnusedUnaryOperator: - active: true - UselessPostfixExpression: - active: true - WrongEqualsTypeParameter: - active: true - -style: - active: true - AlsoCouldBeApply: - active: false - BracesOnIfStatements: - active: false - singleLine: 'never' - multiLine: 'always' - BracesOnWhenStatements: - active: false - singleLine: 'necessary' - multiLine: 'consistent' - CanBeNonNullable: - active: false - CascadingCallWrapping: - active: false - includeElvis: true - ClassOrdering: - active: false - CollapsibleIfStatements: - active: false - DataClassContainsFunctions: - 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: - active: false - ExplicitCollectionElementAccessMethod: - active: false - ExplicitItLambdaParameter: - active: true - 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 - 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: '' - ForbiddenImport: - active: false - imports: [ ] - forbiddenPatterns: '' - ForbiddenMethodCall: - active: false - methods: - - reason: 'print does not allow you to configure the output stream. Use a logger instead.' - value: 'kotlin.io.print' - - reason: 'println does not allow you to configure the output stream. Use a logger instead.' - value: 'kotlin.io.println' - ForbiddenSuppress: - active: false - rules: [ ] - ForbiddenVoid: - active: true - ignoreOverridden: false - ignoreUsageInGenerics: false - FunctionOnlyReturningConstant: - active: true - ignoreOverridableFunction: true - ignoreActualFunction: true - excludedFunctions: [ ] - LoopWithTooManyJumpStatements: - active: true - maxJumpCount: 1 - MagicNumber: - active: true - excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**', '**/*.kts' ] - ignoreNumbers: - - '-1' - - '0' - - '1' - - '2' - ignoreHashCodeFunction: true - ignorePropertyDeclaration: false - ignoreLocalVariableDeclaration: false - ignoreConstantDeclaration: true - ignoreCompanionObjectPropertyDeclaration: true - ignoreAnnotation: false - ignoreNamedArgument: true - ignoreEnums: false - ignoreRanges: false - ignoreExtensionFunctions: true - MandatoryBracesLoops: - active: false - MaxChainedCallsOnSameLine: - active: false - maxChainedCalls: 5 - MaxLineLength: - active: true - maxLineLength: 120 - excludePackageStatements: true - excludeImportStatements: true - excludeCommentStatements: false - excludeRawStrings: true - MayBeConst: - active: true - ModifierOrder: - active: true - MultilineLambdaItParameter: - active: false - MultilineRawStringIndentation: - active: false - indentSize: 4 - trimmingMethods: - - 'trimIndent' - - 'trimMargin' - NestedClassesVisibility: - active: true - NewLineAtEndOfFile: - active: true - NoTabs: - active: false - NullableBooleanCheck: - active: false - ObjectLiteralToLambda: - active: true - OptionalAbstractKeyword: - active: true - OptionalUnit: - active: false - PreferToOverPairSyntax: - active: false - ProtectedMemberInFinalClass: - active: true - RedundantExplicitType: - active: false - RedundantHigherOrderMapUsage: - active: true - RedundantVisibilityModifierRule: - active: false - ReturnCount: - active: true - max: 2 - excludedFunctions: - - 'equals' - excludeLabeled: false - excludeReturnFromLambda: true - excludeGuardClauses: false - SafeCast: - active: true - SerialVersionUIDInSerializableClass: - active: true - SpacingBetweenPackageAndImports: - active: false - StringShouldBeRawString: - active: false - maxEscapedCharacterCount: 2 - ignoredCharacters: [ ] - ThrowsCount: - active: true - max: 2 - excludeGuardClauses: false - TrailingWhitespace: - active: false - TrimMultilineRawString: - active: false - trimmingMethods: - - 'trimIndent' - - 'trimMargin' - UnderscoresInNumericLiterals: - active: false - acceptableLength: 4 - allowNonStandardGrouping: false - UnnecessaryAbstractClass: - active: true - UnnecessaryAnnotationUseSiteTarget: - active: false - UnnecessaryApply: - active: true - UnnecessaryBackticks: - active: false - UnnecessaryBracesAroundTrailingLambda: - active: false - UnnecessaryFilter: - active: true - UnnecessaryInheritance: - active: true - UnnecessaryInnerClass: - active: false - UnnecessaryLet: - active: false - UnnecessaryParentheses: - active: false - allowForUnclearPrecedence: false - UntilInsteadOfRangeTo: - active: false - UnusedImports: - active: false - UnusedParameter: - active: true - allowedNames: 'ignored|expected' - UnusedPrivateClass: - active: true - UnusedPrivateMember: - active: true - allowedNames: '' - UnusedPrivateProperty: - active: true - allowedNames: '_|ignored|expected|serialVersionUID' - UseAnyOrNoneInsteadOfFind: - active: true - UseArrayLiteralsInAnnotations: - active: true - UseCheckNotNull: - active: true - UseCheckOrError: - active: true - UseDataClass: - active: false - allowVars: false - UseEmptyCounterpart: - active: false - UseIfEmptyOrIfBlank: - active: false - UseIfInsteadOfWhen: - active: false - ignoreWhenContainingVariableDeclaration: false - UseIsNullOrEmpty: - active: true - UseLet: - active: false - UseOrEmpty: - active: true - UseRequire: - active: true - UseRequireNotNull: - active: true - UseSumOfInsteadOfFlatMapSize: - active: false - UselessCallOnNotNull: - active: true - UtilityClassWithPublicConstructor: - active: true - VarCouldBeVal: - active: true - ignoreLateinitVar: false - WildcardImport: + InvalidTestFactoryReturnType: active: true - excludeImports: - - 'java.util.*' diff --git a/detekt-rules/build.gradle.kts b/detekt-rules/build.gradle.kts new file mode 100644 index 0000000..cb9d85d --- /dev/null +++ b/detekt-rules/build.gradle.kts @@ -0,0 +1,28 @@ +import org.gradle.kotlin.dsl.libs + +plugins { + alias(libs.plugins.kotlin.gradle.plugin) + id("jvm-test-suite") +} + +group = "org.sdkotlin.detekt" +version = "1.0-SNAPSHOT" + +dependencies { + + compileOnly(libs.detekt.api) + + testImplementation(libs.assertj) + testImplementation(libs.detekt.test) +} + +@Suppress("UnstableApiUsage") +testing { + suites { + configureEach { + if (this is JvmTestSuite) { + useJUnitJupiter(libs.versions.junit.get()) + } + } + } +} diff --git a/detekt-rules/settings.gradle.kts b/detekt-rules/settings.gradle.kts new file mode 100644 index 0000000..01e6496 --- /dev/null +++ b/detekt-rules/settings.gradle.kts @@ -0,0 +1,23 @@ +pluginManagement { + repositories { + mavenCentral() + gradlePluginPortal() + } +} + +dependencyResolutionManagement { + @Suppress("UnstableApiUsage") + repositories { + mavenCentral() + gradlePluginPortal() + } + versionCatalogs { + create("libs") { + from(files("../gradle/libs.versions.toml")) + } + } +} + +includeBuild("../platforms") + +rootProject.name = "detekt-rules" diff --git a/detekt-rules/src/main/kotlin/org/sdkotlin/detekt/junit/InvalidTestFactoryReturnType.kt b/detekt-rules/src/main/kotlin/org/sdkotlin/detekt/junit/InvalidTestFactoryReturnType.kt new file mode 100644 index 0000000..6299f2f --- /dev/null +++ b/detekt-rules/src/main/kotlin/org/sdkotlin/detekt/junit/InvalidTestFactoryReturnType.kt @@ -0,0 +1,98 @@ +package org.sdkotlin.detekt.junit + +import io.gitlab.arturbosch.detekt.api.CodeSmell +import io.gitlab.arturbosch.detekt.api.Config +import io.gitlab.arturbosch.detekt.api.Debt +import io.gitlab.arturbosch.detekt.api.Entity +import io.gitlab.arturbosch.detekt.api.Issue +import io.gitlab.arturbosch.detekt.api.Rule +import io.gitlab.arturbosch.detekt.api.Severity +import io.gitlab.arturbosch.detekt.api.internal.RequiresTypeResolution +import org.jetbrains.kotlin.psi.KtNamedFunction +import org.jetbrains.kotlin.resolve.BindingContext +import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameOrNull +import org.jetbrains.kotlin.types.KotlinType +import org.jetbrains.kotlin.types.typeUtil.supertypes + +@RequiresTypeResolution +class InvalidTestFactoryReturnType(config: Config) : Rule(config) { + + override val issue = Issue( + id = "InvalidTestFactoryReturnType", + severity = Severity.Defect, + description = "JUnit @TestFactory functions must return a valid type.", + debt = Debt.Companion.FIVE_MINS + ) + + override fun visitNamedFunction(function: KtNamedFunction) { + super.visitNamedFunction(function) + + val isTestFactoryFunction = + function.annotationEntries.any { it.text == "@TestFactory" } + + if (isTestFactoryFunction) { + // Get the resolved return type of the function + val returnType = function.resolveReturnType() + + if (returnType != null && !isValidTestFactoryReturnType(returnType)) { + report( + CodeSmell( + issue, + Entity.from(function), + message = "JUnit @TestFactory functions must return " + + "a valid type. Found: $returnType." + ) + ) + } + } + } + + private fun KtNamedFunction.resolveReturnType(): KotlinType? { + // Get the binding context and resolve the return type + return bindingContext[BindingContext.FUNCTION, this]?.returnType + } + + private fun isValidTestFactoryReturnType(type: KotlinType): Boolean { + // Check if it's a subtype of DynamicNode (including DynamicTest and + // DynamicContainer) + if (type.isDynamicNode() + || type.supertypes().any { it.isDynamicNode() } + ) { + return true + } + + // Check if it's a container (e.g., Stream, Collection, Iterable, + // Iterator, Array) of DynamicNode + if (type.isDynamicNodeContainer()) { + return true + } + + return false + } + + private fun KotlinType.isDynamicNode(): Boolean { + val fqName = + this.constructor.declarationDescriptor?.fqNameOrNull()?.asString() + return fqName == "org.junit.jupiter.api.DynamicNode" + } + + private fun KotlinType.isDynamicNodeContainer(): Boolean { + val fqName = + this.constructor.declarationDescriptor?.fqNameOrNull()?.asString() + val isContainerType = + fqName in listOf( + "kotlin.Array", + "kotlin.collections.Collection", + "kotlin.collections.List", + "kotlin.collections.Set", + "kotlin.collections.Iterable", + "kotlin.collections.Iterator", + "java.util.stream.Stream", + ) + + return isContainerType && arguments.any { arg -> + arg.type.isDynamicNode() + || arg.type.supertypes().any { it.isDynamicNode() } + } + } +} diff --git a/detekt-rules/src/main/kotlin/org/sdkotlin/detekt/junit/JUnitRuleSetProvider.kt b/detekt-rules/src/main/kotlin/org/sdkotlin/detekt/junit/JUnitRuleSetProvider.kt new file mode 100644 index 0000000..8f7f536 --- /dev/null +++ b/detekt-rules/src/main/kotlin/org/sdkotlin/detekt/junit/JUnitRuleSetProvider.kt @@ -0,0 +1,18 @@ +package org.sdkotlin.detekt.junit + +import io.gitlab.arturbosch.detekt.api.Config +import io.gitlab.arturbosch.detekt.api.RuleSet +import io.gitlab.arturbosch.detekt.api.RuleSetProvider + +class JUnitRuleSetProvider : RuleSetProvider { + + override val ruleSetId: String = "junit" + + override fun instance(config: Config): RuleSet = + RuleSet( + ruleSetId, + listOf( + InvalidTestFactoryReturnType(config), + ), + ) +} diff --git a/detekt-rules/src/main/resources/META-INF/services/io.gitlab.arturbosch.detekt.api.RuleSetProvider b/detekt-rules/src/main/resources/META-INF/services/io.gitlab.arturbosch.detekt.api.RuleSetProvider new file mode 100644 index 0000000..62e9bf1 --- /dev/null +++ b/detekt-rules/src/main/resources/META-INF/services/io.gitlab.arturbosch.detekt.api.RuleSetProvider @@ -0,0 +1 @@ +org.sdkotlin.detekt.junit.JUnitRuleSetProvider diff --git a/detekt-rules/src/main/resources/config/config.yml b/detekt-rules/src/main/resources/config/config.yml new file mode 100644 index 0000000..e627d5a --- /dev/null +++ b/detekt-rules/src/main/resources/config/config.yml @@ -0,0 +1,3 @@ +junit: + InvalidTestFactoryReturnType: + active: true diff --git a/detekt-rules/src/test/kotlin/org/sdkotlin/detekt/junit/InvalidTestFactoryReturnTypeTest.kt b/detekt-rules/src/test/kotlin/org/sdkotlin/detekt/junit/InvalidTestFactoryReturnTypeTest.kt new file mode 100644 index 0000000..d453b00 --- /dev/null +++ b/detekt-rules/src/test/kotlin/org/sdkotlin/detekt/junit/InvalidTestFactoryReturnTypeTest.kt @@ -0,0 +1,213 @@ +package org.sdkotlin.detekt.junit + +import io.gitlab.arturbosch.detekt.api.Config +import io.gitlab.arturbosch.detekt.api.Finding +import io.gitlab.arturbosch.detekt.rules.KotlinCoreEnvironmentTest +import io.gitlab.arturbosch.detekt.test.assertThat +import io.gitlab.arturbosch.detekt.test.lintWithContext +import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment +import org.junit.jupiter.api.Test + +@KotlinCoreEnvironmentTest +internal class InvalidTestFactoryReturnTypeTest( + private val env: KotlinCoreEnvironment, +) { + + private val rule = InvalidTestFactoryReturnType(Config.empty) + + @Test + fun `reports Unit`() { + + val code = """ + class Testcase { + @TestFactory + fun test() { } + } + """ + + val findings: List = rule.lintWithContext(env, code) + + assertThat(findings) + .hasSize(1).first() + .matches { it.message.contains("Found: Unit") } + } + + @Test + fun `reports List of Unit`() { + + val code = """ + class Testcase { + @TestFactory + fun test() = listOf(Unit) + } + """ + + val findings: List = rule.lintWithContext(env, code) + + assertThat(findings) + .hasSize(1).first() + .matches { it.message.contains("Found: List") } + } + + @Test + fun `does not report single DynamicTest`() { + + val code = """ + import org.junit.jupiter.api.DynamicTest.dynamicTest + class Testcase { + @TestFactory + fun test() = dynamicTest("testing") { } + } + """ + + val findings: List = rule.lintWithContext(env, code) + + assertThat(findings).isEmpty() + } + + @Test + fun `does not report List of DynamicTest`() { + + val code = """ + import org.junit.jupiter.api.DynamicTest.dynamicTest + class Testcase { + @TestFactory + fun test() = + listOf("test 1", "test 2") + .map { testName -> + dynamicTest(testName) { } + } + } + """ + + val findings: List = rule.lintWithContext(env, code) + + assertThat(findings).isEmpty() + } + + @Test + fun `does not report Set of DynamicTest`() { + + val code = """ + import org.junit.jupiter.api.DynamicTest.dynamicTest + class Testcase { + @TestFactory + fun test() = + listOf("test 1", "test 2") + .map { testName -> + dynamicTest(testName) { } + } + .toSet() + } + """ + + val findings: List = rule.lintWithContext(env, code) + + assertThat(findings).isEmpty() + } + + @Test + fun `does not report Iterable of DynamicTest`() { + + val code = """ + import org.junit.jupiter.api.DynamicTest + import org.junit.jupiter.api.DynamicTest.dynamicTest + class Testcase { + @TestFactory + fun test() = + listOf("test 1", "test 2") + .map { testName -> + dynamicTest(testName) { } + } as Iterable + } + """ + + val findings: List = rule.lintWithContext(env, code) + + assertThat(findings).isEmpty() + } + + @Test + fun `does not report Collection of DynamicTest`() { + + val code = """ + import org.junit.jupiter.api.DynamicTest + import org.junit.jupiter.api.DynamicTest.dynamicTest + class Testcase { + @TestFactory + fun test() = + listOf("test 1", "test 2") + .map { testName -> + dynamicTest(testName) { } + } as Collection + } + """ + + val findings: List = rule.lintWithContext(env, code) + + assertThat(findings).isEmpty() + } + + @Test + fun `does not report Iterator of DynamicTest`() { + + val code = """ + import org.junit.jupiter.api.DynamicTest.dynamicTest + class Testcase { + @TestFactory + fun test() = + listOf("test 1", "test 2") + .map { testName -> + dynamicTest(testName) { } + } + .iterator() + } + """ + + val findings: List = rule.lintWithContext(env, code) + + assertThat(findings).isEmpty() + } + + @Test + fun `does not report Stream of DynamicTest`() { + + val code = """ + import org.junit.jupiter.api.DynamicTest.dynamicTest + class Testcase { + @TestFactory + fun test() = + listOf("test 1", "test 2") + .map { testName -> + dynamicTest(testName) { } + } + .stream() + } + """ + + val findings: List = rule.lintWithContext(env, code) + + assertThat(findings).isEmpty() + } + + @Test + fun `does not report Array of DynamicTest`() { + + val code = """ + import org.junit.jupiter.api.DynamicTest.dynamicTest + class Testcase { + @TestFactory + fun test() = + listOf("test 1", "test 2") + .map { testName -> + dynamicTest(testName) { } + } + .toTypedArray() + } + """ + + val findings: List = rule.lintWithContext(env, code) + + assertThat(findings).isEmpty() + } +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 14cf6b8..71b82f3 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -40,10 +40,18 @@ version.ref = "assertj" module = "com.autonomousapps.dependency-analysis:com.autonomousapps.dependency-analysis.gradle.plugin" version.ref = "dependency-analysis-gradle-plugin" +[libraries.detekt-api] +module = "io.gitlab.arturbosch.detekt:detekt-api" +version.ref = "detekt" + [libraries.detekt-gradle-plugin-dependency] module = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin" version.ref = "detekt" +[libraries.detekt-test] +module = "io.gitlab.arturbosch.detekt:detekt-test" +version.ref = "detekt" + [libraries.equalsverifier] module = "nl.jqno.equalsverifier:equalsverifier" version.ref = "equalsverifier" diff --git a/subprojects/effective-kotlin/detekt-baseline.xml b/subprojects/effective-kotlin/detekt-baseline.xml deleted file mode 100644 index 0748295..0000000 --- a/subprojects/effective-kotlin/detekt-baseline.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - FunctionNaming:CommonMethods.kt$fun `with data classes`() - FunctionNaming:ConsiderStaticFactoryMethods.kt$fun `with Java static factory functions`() - FunctionNaming:ConsiderStaticFactoryMethods.kt$fun `with Kotlin companion object extension factory functions`() - FunctionNaming:ConsiderStaticFactoryMethods.kt$fun `with Kotlin companion object factory functions`() - FunctionNaming:ConsiderStaticFactoryMethods.kt$fun `with Kotlin top-level factory functions`() - FunctionNaming:FavorComposition.kt$fun `with decorators`() - FunctionNaming:FavorComposition.kt$fun `with prohibiting or documenting for inheritance`() - MagicNumber:CommonMethods.kt$22 - MagicNumber:CommonMethods.kt$32 - MagicNumber:ConsiderStaticFactoryMethods.kt$3 - MagicNumber:ControlStructuresAsExpressions.kt$3 - MagicNumber:ControlStructuresAsExpressions.kt$4 - MagicNumber:Destructuring.kt$3 - MagicNumber:MakeDefensiveCopies.kt$OlympicTriplets$33 - MatchingDeclarationName:AccessorsOverFields.kt$Programmer - MatchingDeclarationName:AvoidStrings.kt$EmailAddress - MatchingDeclarationName:CommonMethods.kt$Person - MatchingDeclarationName:ConsiderBuilders.kt$NutritionFacts - MatchingDeclarationName:Destructuring.kt$Point3D - MatchingDeclarationName:Singletons.kt$HelloSingleton - SwallowedException:ControlStructuresAsExpressions.kt$e: JSONException - - diff --git a/subprojects/kotlin-dl/detekt-baseline.xml b/subprojects/kotlin-dl/detekt-baseline.xml deleted file mode 100644 index 2251828..0000000 --- a/subprojects/kotlin-dl/detekt-baseline.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - MagicNumber:FashionMnist.kt$100 - MagicNumber:FashionMnist.kt$300 - - diff --git a/subprojects/kotlin-for-java-devs-client/detekt-baseline.xml b/subprojects/kotlin-for-java-devs-client/detekt-baseline.xml deleted file mode 100644 index d2a97fb..0000000 --- a/subprojects/kotlin-for-java-devs-client/detekt-baseline.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - MagicNumber:OtherModuleAndPackageNPC.kt$OtherModuleAndPackageNPC$100 - PackageNaming:OtherModuleAndPackageNPC.kt$package org.sdkotlin.intro.kotlin._30_sealedtypes.otherpackage - PackageNaming:OtherModulePlayer.kt$package org.sdkotlin.intro.kotlin._30_sealedtypes - PackageNaming:SealedTypeSmartCastFromOtherModule.kt$package org.sdkotlin.intro.kotlin._30_sealedtypes - - diff --git a/subprojects/kotlin-for-java-devs/detekt-baseline.xml b/subprojects/kotlin-for-java-devs/detekt-baseline.xml deleted file mode 100644 index b0930e8..0000000 --- a/subprojects/kotlin-for-java-devs/detekt-baseline.xml +++ /dev/null @@ -1,281 +0,0 @@ - - - - - CyclomaticComplexMethod:NullSafetyInKotlin.kt$fun main() - EmptyFunctionBlock:FunctionsInKotlin.kt${} - ForEachOnRange:CoroutinesInKotlin.kt$1..ONE_MILLION - ForEachOnRange:IterationInKotlin.kt$1 until 5 - ForEachOnRange:IterationInKotlin.kt$1..5 - ForbiddenComment:ReflectionInKotlin.kt$// TODO: Add reflection example for Kotlin. - ForbiddenComment:ScopingFunctionsInKotlin.kt$// TODO: Add scoping functions example for Kotlin. - ForbiddenComment:TailRecursionInKotlin.kt$// TODO: Why does stack depth change and why does this not succeed? - FunctionNaming:AnnotationsInKotlin.kt$fun `with deprecation`() - FunctionNaming:DataClassesInKotlin.kt$fun `with component and copy functions`() - FunctionNaming:DataClassesInKotlin.kt$fun `with data classes in the standard library`() - FunctionNaming:DataClassesInKotlin.kt$fun `with equals, hashCode, and toString`() - FunctionNaming:DataClassesInKotlin.kt$fun `with private data class constructor`() - FunctionNaming:DelegationInKotlin.kt$fun `creating property delegates`() - FunctionNaming:DelegationInKotlin.kt$fun `with delegates`() - FunctionNaming:DelegationInKotlin.kt$fun `with deprecated property delegation`() - FunctionNaming:DelegationInKotlin.kt$fun `with lateInit`() - FunctionNaming:DelegationInKotlin.kt$fun `with the Lazy property delegate`() - FunctionNaming:DelegationInKotlin.kt$fun `with the NotNull property delegate`() - FunctionNaming:DelegationInKotlin.kt$fun `with the Observable property delegate`() - FunctionNaming:DelegationInKotlin.kt$fun `with the Vetoable property delegate`() - FunctionNaming:DelegationInKotlin.kt$fun `with the map-backed property delegate`() - FunctionNaming:DelegationInKotlin.kt$fun `with the mutable map-backed property delegate`() - FunctionNaming:EnumsInKotlin.kt$fun `while driving`(light: TrafficLight) - FunctionNaming:EnumsInKotlin.kt$fun `with states`() - FunctionNaming:GenericsInKotlin.kt$fun `better give and receive`() - FunctionNaming:GenericsInKotlin.kt$fun `gift anything`() - FunctionNaming:GenericsInKotlin.kt$fun `give and receive FAIL`() - FunctionNaming:GenericsInKotlin.kt$fun `only from Mom`() - FunctionNaming:GenericsInKotlin.kt$fun `only open on your birthday`() - FunctionNaming:InfixFunctionsInKotlin.kt$infix fun Int.`+-`(other: Int) - FunctionNaming:VarianceInKotlin.kt$fun `with array and collection variance`() - FunctionNaming:VarianceInKotlin.kt$fun `with consumers`() - FunctionNaming:VarianceInKotlin.kt$fun `with producers`() - FunctionNaming:VarianceInKotlin.kt$fun `with simple container variance`() - FunctionNaming:VarianceInKotlin.kt$fun `with star projections`() - FunctionNaming:VarianceInKotlin.kt$fun `with substitution`() - FunctionNaming:VarianceInKotlin.kt$fun `with use-site variance`() - FunctionOnlyReturningConstant:AnnotationsInKotlin.kt$@ArrayAnnotation(["One", "Two"]) fun arrayAnnotations() - FunctionOnlyReturningConstant:AnnotationsInKotlin.kt$@MetaGreat(InherentlyGreat()) fun greatness() - FunctionOnlyReturningConstant:AnnotationsInKotlin.kt$@RedundantAnnotation @RedundantAnnotation fun test() - FunctionOnlyReturningConstant:AnnotationsInKotlin.kt$@Suppress("unused") fun notUsed() - FunctionOnlyReturningConstant:AnnotationsInKotlin.kt$@Suppress(unused) fun alsoUnused() - FunctionOnlyReturningConstant:AnnotationsInKotlin.kt$@Valuable("This much") fun valuation() - FunctionOnlyReturningConstant:AnnotationsInKotlin.kt$@VarargAnnotation("One", "Two") fun varagAnnotations() - FunctionOnlyReturningConstant:ExtensionFunctionsInKotlin.kt$fun Animal.name() - FunctionOnlyReturningConstant:ExtensionFunctionsInKotlin.kt$fun Lion.name() - FunctionOnlyReturningConstant:HigherOrderFunctionsAndLambdasInKotlin.kt$fun theBoss() - FunctionOnlyReturningConstant:StaticInKotlin.kt$StaticInKotlin$fun instanceFunction() - FunctionOnlyReturningConstant:TddInKotlin.kt$TddInKotlin$fun weCanDoIt() - FunctionOnlyReturningConstant:UnionTypesInKotlin.kt$Garbage$fun throwAway() - FunctionOnlyReturningConstant:Utilities.kt$internal fun itsYourBirthday() - InvalidPackageDeclaration:PackagesInKotlin.kt$package somewhere.over.the.rainbow - InvalidRange:RangesInKotlin.kt$1..0 - LongMethod:NullSafetyInKotlin.kt$fun main() - MagicNumber:ArraysInKotlin.kt$100 - MagicNumber:ArraysInKotlin.kt$200 - MagicNumber:ArraysInKotlin.kt$3 - MagicNumber:ArraysInKotlin.kt$3.0 - MagicNumber:ArraysInKotlin.kt$300 - MagicNumber:ArraysInKotlin.kt$4 - MagicNumber:ArraysInKotlin.kt$5 - MagicNumber:ArraysInKotlin.kt$6 - MagicNumber:CollectionsInKotlin.kt$10 - MagicNumber:CollectionsInKotlin.kt$100 - MagicNumber:CollectionsInKotlin.kt$3 - MagicNumber:DelegationInKotlin.kt$1025 - MagicNumber:DelegationInKotlin.kt$3 - MagicNumber:EnumsInKotlin.kt$40 - MagicNumber:EnumsInKotlin.kt$TrafficLight.CAUTION$5 - MagicNumber:EnumsInKotlin.kt$TrafficLight.GO$30 - MagicNumber:EnumsInKotlin.kt$TrafficLight.STOP$20 - MagicNumber:EnumsInKotlin.kt$Trio.BASS$4 - MagicNumber:EnumsInKotlin.kt$Trio.GUITAR$6 - MagicNumber:FunctionsInKotlin.kt$3 - MagicNumber:GenericsInKotlin.kt$36 - MagicNumber:HigherOrderFunctionsAndLambdasInKotlin.kt$113 - MagicNumber:HigherOrderFunctionsAndLambdasInKotlin.kt$3 - MagicNumber:HigherOrderFunctionsAndLambdasInKotlin.kt$355 - MagicNumber:HigherOrderFunctionsAndLambdasInKotlin.kt$4 - MagicNumber:InlineClassesInKotlin.kt$100 - MagicNumber:InlineClassesInKotlin.kt$3 - MagicNumber:IterationInKotlin.kt$5 - MagicNumber:NullSafetyInKotlin.kt$16 - MagicNumber:RangesInKotlin.kt$10 - MagicNumber:RangesInKotlin.kt$10.5 - MagicNumber:RangesInKotlin.kt$10.5f - MagicNumber:RangesInKotlin.kt$10L - MagicNumber:RangesInKotlin.kt$11 - MagicNumber:RangesInKotlin.kt$12 - MagicNumber:RangesInKotlin.kt$19 - MagicNumber:RangesInKotlin.kt$20 - MagicNumber:RangesInKotlin.kt$2020 - MagicNumber:RangesInKotlin.kt$3 - MagicNumber:RangesInKotlin.kt$31 - MagicNumber:RangesInKotlin.kt$4 - MagicNumber:RangesInKotlin.kt$6 - MagicNumber:SelectionInKotlin.kt$10 - MagicNumber:SelectionInKotlin.kt$100 - MagicNumber:SequencesInKotlin.kt$10 - MagicNumber:SequencesInKotlin.kt$100 - MagicNumber:SequencesInKotlin.kt$1000 - MagicNumber:SequencesInKotlin.kt$5 - MagicNumber:SequencesInKotlin.kt$50 - MagicNumber:TailRecursionDebugging.kt$10 - MagicNumber:TailRecursionDebugging.kt$15 - MagicNumber:TailRecursionInKotlin.kt$5 - MagicNumber:UnionTypesInKotlin.kt$127 - MagicNumber:UnionTypesInKotlin.kt$3 - MagicNumber:UnionTypesInKotlin.kt$4 - MagicNumber:VarianceInKotlin.kt$<no name provided>$5 - MagicNumber:VarianceInKotlin.kt$NaiveTester$5 - MatchingDeclarationName:ImportsInKotlin.kt$Thing1 - MatchingDeclarationName:OperatorOverloadingInKotlin.kt$Zebra - MayBeConst:ConstantsInKotlin.kt$@JvmField val JVM_FIELD_VAL = "Testing @JvmField val" - MayBeConst:ConstantsInKotlin.kt$ConstantsInKotlinObject$val OBJECT_VAL = "val in object" - MayBeConst:ConstantsInKotlin.kt$private val PRIVATE_VAL = "private val" - MayBeConst:ConstantsInKotlin.kt$val REGULAR_VAL = "val" - MayBeConst:ConstantsInKotlinCompanion.kt$ConstantsInKotlinCompanion.Companion$@JvmField val COMPANION_JVM_FIELD_VAL = "Testing @JvmField val in object" - MayBeConst:ConstantsInKotlinObject.kt$ConstantsInKotlinObject$@JvmField val OBJECT_JVM_FIELD_VAL = "Testing @JvmField val in object" - MayBeConst:HigherOrderFunctionsAndLambdasInKotlin.kt$val almostPi = 355 / 113 - MayBeConst:UnsignedTypesInKotlin.kt$val binUByte: UByte = 0b0000_0001u - MayBeConst:UnsignedTypesInKotlin.kt$val hexUByte: UByte = 0x01u - MayBeConst:UnsignedTypesInKotlin.kt$val uByte: UByte = 255u // or uppercase 255U - MayBeConst:UnsignedTypesInKotlin.kt$val uInt = 0u // UInt inferred type if literal fits - MayBeConst:UnsignedTypesInKotlin.kt$val uLong = 0xFF_FF_FF_FF_01u // ULong inferred when literal doesn't fit UInt - MayBeConst:VariablesAndTypesInKotlin.kt$val boolean = false // Boolean - MayBeConst:VariablesAndTypesInKotlin.kt$val byte: Byte = 0 // Byte, type required because no literal - MayBeConst:VariablesAndTypesInKotlin.kt$val character = 'c' // Char, can't be treated as a number - MayBeConst:VariablesAndTypesInKotlin.kt$val double = 0.0 // Double, 'd/D' not supported - MayBeConst:VariablesAndTypesInKotlin.kt$val float = 0.0f // Float, 'F' also supported - MayBeConst:VariablesAndTypesInKotlin.kt$val i = 0 - MayBeConst:VariablesAndTypesInKotlin.kt$val integer = 0 // Int - MayBeConst:VariablesAndTypesInKotlin.kt$val long = 0L // Long, lowercase 'l' not supported - PackageNaming:AbstractClassesInKotlin.kt$package org.sdkotlin.intro.kotlin._19_abstractclasses - PackageNaming:AiNPC.kt$package org.sdkotlin.intro.kotlin._30_sealedtypes.otherpackage - PackageNaming:AnnotationsInKotlin.kt$package org.sdkotlin.intro.kotlin._31_annotations - PackageNaming:ArraysInKotlin.kt$package org.sdkotlin.intro.kotlin._24_arrays - PackageNaming:ClassesInKotlin.kt$package org.sdkotlin.intro.kotlin._00_classes - PackageNaming:CollectionsInKotlin.kt$package org.sdkotlin.intro.kotlin._26_collections - PackageNaming:ConstantsInKotlin.kt$package org.sdkotlin.intro.kotlin._17_constants - PackageNaming:ConstantsInKotlin.kt$package org.sdkotlin.javainterop._XX_constants - PackageNaming:ConstantsInKotlinCompanion.kt$package org.sdkotlin.javainterop._XX_constants - PackageNaming:ConstantsInKotlinObject.kt$package org.sdkotlin.javainterop._XX_constants - PackageNaming:ConstructorsAndInitializersInKotlin.kt$package org.sdkotlin.intro.kotlin._13_constructors - PackageNaming:CoroutinesInKotlin.kt$package org.sdkotlin.intro.kotlin._XX_coroutines - PackageNaming:DataClassesInKotlin.kt$package org.sdkotlin.intro.kotlin._14_0_dataclasses - PackageNaming:DelegationInKotlin.kt$package org.sdkotlin.intro.kotlin._32_delegation - PackageNaming:EnumsInKotlin.kt$package org.sdkotlin.intro.kotlin._29_enums - PackageNaming:EqualityInKotlin.kt$package org.sdkotlin.intro.kotlin._07_equality - PackageNaming:ExtensionFunctionScopingInKotlin.kt$package org.sdkotlin.intro.kotlin._08_3_extensionfunctions.otherpackage - PackageNaming:ExtensionFunctionsInKotlin.kt$package org.sdkotlin.intro.kotlin._08_3_extensionfunctions - PackageNaming:FunctionsInKotlin.kt$package org.sdkotlin.intro.kotlin._08_0_functions - PackageNaming:GenericsInKotlin.kt$package org.sdkotlin.intro.kotlin._23_generics - PackageNaming:HelloKotlin.kt$package org.sdkotlin.intro.kotlin._02_helloworld - PackageNaming:HelloWithArgs.kt$package org.sdkotlin.intro.kotlin._02_helloworld.withargs - PackageNaming:HigherOrderFunctionsAndLambdasInKotlin.kt$package org.sdkotlin.intro.kotlin._08_1_higherorderfunctions - PackageNaming:ImportsInKotlin.kt$package org.sdkotlin.intro.kotlin._04_imports - PackageNaming:InfixFunctionsInKotlin.kt$package org.sdkotlin.intro.kotlin._08_5_infixfunctions - PackageNaming:InheritanceInKotlin.kt$package org.sdkotlin.intro.kotlin._18_inheritance - PackageNaming:InlineClassesInKotlin.kt$package org.sdkotlin.intro.kotlin._14_1_inlineclasses - PackageNaming:InterfacesInKotlin.kt$package org.sdkotlin.intro.kotlin._20_interfaces - PackageNaming:IterationInKotlin.kt$package org.sdkotlin.intro.kotlin._11_iteration - PackageNaming:LateInit.kt$package org.sdkotlin.intro.kotlin._32_delegation - PackageNaming:NullSafetyInKotlin.kt$package org.sdkotlin.intro.kotlin._22_nullsafety - PackageNaming:OperatorOverloadingInKotlin.kt$package org.sdkotlin.intro.kotlin._08_4_operatorfunctions - PackageNaming:OtherPackagePlayer.kt$package org.sdkotlin.intro.kotlin._30_sealedtypes.otherpackage - PackageNaming:PolyglotPersonTest.kt$package org.sdkotlin.intro.kotlin._14_0_dataclasses - PackageNaming:PropertiesInKotlin.kt$package org.sdkotlin.intro.kotlin._12_properties - PackageNaming:RangesInKotlin.kt$package org.sdkotlin.intro.kotlin._09_ranges - PackageNaming:ReflectionInKotlin.kt$package org.sdkotlin.intro.kotlin._XX_reflection - PackageNaming:ScopingFunctionsInKotlin.kt$package org.sdkotlin.intro.kotlin._XX_scopingfunctions - PackageNaming:SealedTypesInKotlin.kt$package org.sdkotlin.intro.kotlin._30_sealedtypes - PackageNaming:SelectionInKotlin.kt$package org.sdkotlin.intro.kotlin._10_selection - PackageNaming:SequencesInKotlin.kt$package org.sdkotlin.intro.kotlin._27_sequences - PackageNaming:SingletonInKotlin.kt$package org.sdkotlin.intro.kotlin._15_singletons - PackageNaming:SmartCastsInKotlin.kt$package org.sdkotlin.intro.kotlin._21_smartcasts - PackageNaming:StaticInKotlin.kt$package org.sdkotlin.intro.kotlin._16_static - PackageNaming:StringsInKotlin.kt$package org.sdkotlin.intro.kotlin._06_strings - PackageNaming:TailRecursionDebugging.kt$package org.sdkotlin.intro.kotlin._08_2_tailrecursivefunctions - PackageNaming:TailRecursionInKotlin.kt$package org.sdkotlin.intro.kotlin._08_2_tailrecursivefunctions - PackageNaming:TddInKotlin.kt$package org.sdkotlin.intro.kotlin._XX_tdd - PackageNaming:TddInKotlinTest.kt$package org.sdkotlin.intro.kotlin._XX_tdd - PackageNaming:Thing1.kt$package org.sdkotlin.intro.kotlin._04_imports.otherpackage - PackageNaming:TopLevelInKotlin.kt$package org.sdkotlin.intro.kotlin._03_toplevel - PackageNaming:TopLevelUsageInKotlin.kt$package org.sdkotlin.intro.kotlin._03_toplevel.usage - PackageNaming:TryWithResourcesInKotlin.kt$package org.sdkotlin.intro.kotlin._XX_try_w_resources - PackageNaming:UnionTypesInKotlin.kt$package org.sdkotlin.intro.kotlin._XX_uniontypes - PackageNaming:UnknownPlayer.kt$package org.sdkotlin.intro.kotlin._30_sealedtypes - PackageNaming:UnsignedTypesInKotlin.kt$package org.sdkotlin.intro.kotlin._05_1_unsigned_types - PackageNaming:Utilities.kt$package org.sdkotlin.intro.kotlin._23_generics.util - PackageNaming:VarargsInKotlin.kt$package org.sdkotlin.intro.kotlin._25_varargfunctions - PackageNaming:VariablesAndTypesInKotlin.kt$package org.sdkotlin.intro.kotlin._05_0_variables_and_types - PackageNaming:VarianceInKotlin.kt$package org.sdkotlin.intro.kotlin._28_variance - PrintStackTrace:TryWithResourcesInKotlin.kt$e - SerialVersionUIDInSerializableClass:InterfacesInKotlin.kt$Circle : ShapeSerializable - SerialVersionUIDInSerializableClass:InterfacesInKotlin.kt$Triangle : ShapeSerializable - SpreadOperator:VarargsInKotlin.kt$(*arrayOfThings) - SwallowedException:CoroutinesInKotlin.kt$e: OutOfMemoryError - SwallowedException:NullSafetyInKotlin.kt$e: IllegalStateException - SwallowedException:NullSafetyInKotlin.kt$e: NullPointerException - SwallowedException:SequencesInKotlin.kt$e: NullPointerException - SwallowedException:SmartCastsInKotlin.kt$e: ClassCastException - SwallowedException:TailRecursionInKotlin.kt$e: StackOverflowError - TooGenericExceptionCaught:ArraysInKotlin.kt$e: ArrayIndexOutOfBoundsException - TooGenericExceptionCaught:NullSafetyInKotlin.kt$e: NullPointerException - TooGenericExceptionCaught:SequencesInKotlin.kt$e: NullPointerException - TooManyFunctions:AnnotationsInKotlin.kt$org.sdkotlin.intro.kotlin._31_annotations.AnnotationsInKotlin.kt - TooManyFunctions:DelegationInKotlin.kt$org.sdkotlin.intro.kotlin._32_delegation.DelegationInKotlin.kt - TooManyFunctions:FunctionsInKotlin.kt$org.sdkotlin.intro.kotlin._08_0_functions.FunctionsInKotlin.kt - TopLevelPropertyNaming:AnnotationsInKotlin.kt$const val unused = "unused" - UnusedPrivateProperty:ArraysInKotlin.kt$val arrayOfNullableInts: Array<Int?> = arrayOf(1, null, 3) - UnusedPrivateProperty:ArraysInKotlin.kt$val booleanArray: BooleanArray = booleanArrayOf(true, false, true) - UnusedPrivateProperty:ArraysInKotlin.kt$val intArray: IntArray = intArrayOf(1, 2, 3) - UnusedPrivateProperty:ArraysInKotlin.kt$val noInts = emptyArray<Int>() - UnusedPrivateProperty:ArraysInKotlin.kt$val noStrings = emptyArray<String>() - UnusedPrivateProperty:ArraysInKotlin.kt$val nullInts = arrayOfNulls<Int>(size = 10) - UnusedPrivateProperty:ArraysInKotlin.kt$val numerals = Array(size = 10) { index -> index.toString() } - UnusedPrivateProperty:ArraysInKotlin.kt$val randomInts = Array(size = 10) { (1..100).random() } - UnusedPrivateProperty:CollectionsInKotlin.kt$val arrayListOfInts = arrayListOf(1, 2, 3).toList() - UnusedPrivateProperty:CollectionsInKotlin.kt$val fastMap = mutableMapOf<Int, String>().also { it[1] = "1" it[2] = "2" it[3] = "3" }.toMap() - UnusedPrivateProperty:CollectionsInKotlin.kt$val hashMapOfIntsToStrings = hashMapOf(1 to "1", 2 to "2", 3 to "3").toMap() - UnusedPrivateProperty:CollectionsInKotlin.kt$val hashSetOfInts = hashSetOf(1, 2, 3).toSet() - UnusedPrivateProperty:CollectionsInKotlin.kt$val listOfStrings = List(10) { index -> index.toString() } - UnusedPrivateProperty:CollectionsInKotlin.kt$val mapOfIntsToStrings = mapOf(1 to "1", 2 to "2", 3 to "3") - UnusedPrivateProperty:CollectionsInKotlin.kt$val mutableListOfStrings = MutableList(10) { index -> index.toString() } - UnusedPrivateProperty:CollectionsInKotlin.kt$val secondListOfInts = mutableCopiedListOfInts.toList() - UnusedPrivateProperty:CollectionsInKotlin.kt$val setOfInts = setOf(1, 2, 3) - UnusedPrivateProperty:ConstantsInKotlin.kt$private val PRIVATE_VAL = "private val" - UnusedPrivateProperty:ConstructorsAndInitializersInKotlin.kt$val han = Rebel("Han", false) - UnusedPrivateProperty:ConstructorsAndInitializersInKotlin.kt$val jabba = Hutt("Jabba", true) - UnusedPrivateProperty:ConstructorsAndInitializersInKotlin.kt$val luke = Rebel("Luke", true) - UnusedPrivateProperty:ConstructorsAndInitializersInKotlin.kt$val vader = Imperial("Darth Vader", true) - UnusedPrivateProperty:ConstructorsAndInitializersInKotlin.kt$val wicket = Ewok("Wicket") - UnusedPrivateProperty:GenericsInKotlin.kt$val amountOfPie = gift * 36 // `gift` is a `Double` now, so good to go. - UnusedPrivateProperty:GenericsInKotlin.kt$val amountOfPie = gift?.times(36) ?: 0.0 - UnusedPrivateProperty:GenericsInKotlin.kt$val largeSurprise = generousGift.asPresent() - UnusedPrivateProperty:GenericsInKotlin.kt$val perishableSurprise = yummyGift.asPresent() - UnusedPrivateProperty:NullSafetyInKotlin.kt$val definitelyGreatGazoo = GreatGazoo() - UnusedPrivateProperty:NullSafetyInKotlin.kt$val maybeGreatGazoo: GreatGazoo? = null - UnusedPrivateProperty:NullSafetyInKotlin.kt$val requiredName = nullableName ?: throw IllegalArgumentException("More specific than a NPE.") - UnusedPrivateProperty:NullSafetyInKotlin.kt$var age = 16 - UnusedPrivateProperty:NullSafetyInKotlin.kt$var nullableAge: Int? - UnusedPrivateProperty:RangesInKotlin.kt$val doubleRange = 1.0..10.5 - UnusedPrivateProperty:RangesInKotlin.kt$val floatRange = 1.0f..10.5f - UnusedPrivateProperty:RangesInKotlin.kt$val longRange = 0L..10L - UnusedPrivateProperty:RangesInKotlin.kt$val oddNumbersBackwards = 19 downTo 1 step 2 - UnusedPrivateProperty:RangesInKotlin.kt$val oneThroughTenIterator = oneThroughTen.iterator() - UnusedPrivateProperty:RangesInKotlin.kt$val openEndedIntRange: IntRange = 0 until 10 // 0-9 - UnusedPrivateProperty:RangesInKotlin.kt$val openEndedIntRangeOperator: IntRange = 0..<10 - UnusedPrivateProperty:RangesInKotlin.kt$val reverseIntegralProgression = 10 downTo 1 - UnusedPrivateProperty:SelectionInKotlin.kt$val isItANumber = when (randomBinaryInt) { // All Ints are Numbers. is Number -> true // And yet the compiler still requires this `else`. else -> false } - UnusedPrivateProperty:SequencesInKotlin.kt$val nope = streamBigEven + 1 - UnusedPrivateProperty:SmartCastsInKotlin.kt$val integer = thing as Int - UnusedPrivateProperty:VarianceInKotlin.kt$val KABLAMO: String = backToStringContainer.contents - UnusedPrivateProperty:VarianceInKotlin.kt$val anyList: List<Any> = stringList - UnusedPrivateProperty:VarianceInKotlin.kt$val anyProducer: Producer<Any> = stringProducer - UnusedPrivateProperty:VarianceInKotlin.kt$val anyTest = anyTester.test(any) - UnusedPrivateProperty:VarianceInKotlin.kt$val immutableStringContainer = ImmutableContainer("Hello") - UnusedPrivateProperty:VarianceInKotlin.kt$val indicesOfAnyAnythings = indicesOfAny(arrayOfAny) - UnusedPrivateProperty:VarianceInKotlin.kt$val indicesOfAnyStrings = indicesOfAny(arrayOfString) - UnusedPrivateProperty:VarianceInKotlin.kt$val indicesOfAnythings = indices(arrayOfAny) - UnusedPrivateProperty:VarianceInKotlin.kt$val indicesOfEAnythings = indicesOf(arrayOfAny) - UnusedPrivateProperty:VarianceInKotlin.kt$val indicesOfEStrings = indicesOf(arrayOfString) - UnusedPrivateProperty:VarianceInKotlin.kt$val indicesOfMaybeAnyAnythings = indicesOfAny(arrayOfMaybeAny) - UnusedPrivateProperty:VarianceInKotlin.kt$val indicesOfMaybeEAnythings = indicesOf(arrayOfMaybeAny) - UnusedPrivateProperty:VarianceInKotlin.kt$val indicesOfStrings = indices(arrayOfString) - UnusedPrivateProperty:VarianceInKotlin.kt$val mutableStringList = mutableListOf("Hello", "World") - UnusedPrivateProperty:VarianceInKotlin.kt$val naiveStringTester = NaiveTester<String>() - UnusedPrivateProperty:VarianceInKotlin.kt$val otherStringTest = anyTester.test(string) - UnusedPrivateProperty:VarianceInKotlin.kt$val stringArray = arrayOf("Hello", "World") - UnusedPrivateProperty:VarianceInKotlin.kt$val stringTest = stringTester.test(string) - UtilityClassWithPublicConstructor:ConstantsInKotlin.kt$ConstantsInKotlinCompanion - UtilityClassWithPublicConstructor:ConstantsInKotlinCompanion.kt$ConstantsInKotlinCompanion - VariableNaming:VarianceInKotlin.kt$val KABLAMO: String = backToStringContainer.contents - - diff --git a/subprojects/ksp-builder-generator/processor/detekt-baseline.xml b/subprojects/ksp-builder-generator/processor/detekt-baseline.xml deleted file mode 100644 index 94b73ea..0000000 --- a/subprojects/ksp-builder-generator/processor/detekt-baseline.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - LongMethod:BuilderGenVisitor.kt$BuilderGenVisitor$override fun visitFunctionDeclaration( function: KSFunctionDeclaration, data: Unit, ) - UnusedPrivateProperty:BuilderGenVisitor.kt$BuilderGenVisitor$private val logger: KSPLogger - - diff --git a/subprojects/tdd-in-kotlin/detekt-baseline.xml b/subprojects/tdd-in-kotlin/detekt-baseline.xml deleted file mode 100644 index fab5596..0000000 --- a/subprojects/tdd-in-kotlin/detekt-baseline.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - ForEachOnRange:FizzBuzz.kt$1..100 - MagicNumber:FizzBuzz.kt$100 - MagicNumber:FizzBuzz.kt$15 - MagicNumber:FizzBuzz.kt$3 - MagicNumber:FizzBuzz.kt$5 - ReturnCount:FizzBuzz.kt$internal fun fizzBuzzOf(n: Int): String - - diff --git a/subprojects/typed-errors-in-kotlin/detekt-baseline.xml b/subprojects/typed-errors-in-kotlin/detekt-baseline.xml deleted file mode 100644 index f1bfbe5..0000000 --- a/subprojects/typed-errors-in-kotlin/detekt-baseline.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - MagicNumber:TypedErrorsWithEither.kt$3 - MagicNumber:TypedErrorsWithEither.kt$5.0 - MagicNumber:TypedErrorsWithRaise.kt$3 - MagicNumber:TypedErrorsWithRaise.kt$5.0 - MatchingDeclarationName:TypedErrorsWithEither.kt$FruitBasketBuilder - MatchingDeclarationName:TypedErrorsWithRaise.kt$FruitBasketBuilder - -