From 0ae48dee330a451d930a7ac2b243453d06c8f06e Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Wed, 8 Mar 2023 01:47:19 +0530 Subject: [PATCH] feat(build): remove Detekt and switch to Slack's Compose lints --- .github/renovate.json5 | 11 - .github/workflows/ci.yml | 7 - android/lint-baseline.xml | 76 +- api/lint-baseline.xml | 2 +- build-logic/build.gradle.kts | 1 - .../claw/gradle/AndroidCommonPlugin.kt | 6 + .../claw/gradle/DependencyUpdatesPlugin.kt | 2 +- .../dev/msfjarvis/claw/gradle/Detekt.kt | 35 - .../claw/gradle/KotlinCommonPlugin.kt | 3 +- common/lint-baseline.xml | 13 +- config/detekt/detekt.yml | 733 ------------------ core/build.gradle.kts | 2 +- core/lint-baseline.xml | 2 +- database/lint-baseline.xml | 2 +- detekt-baselines/android.xml | 7 - detekt-baselines/model.xml | 7 - gradle/libs.versions.toml | 2 +- metadata-extractor/build.gradle.kts | 2 +- 18 files changed, 101 insertions(+), 812 deletions(-) delete mode 100644 build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/Detekt.kt delete mode 100644 config/detekt/detekt.yml delete mode 100644 detekt-baselines/android.xml delete mode 100644 detekt-baselines/model.xml diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 502361e8..ca73fb38 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -55,17 +55,6 @@ "depNameTemplate": "com.facebook:ktfmt", "registryUrlTemplate": "https://repo1.maven.org/maven2/", }, - { - "fileMatch": [ - "Detekt\.kt$" - ], - "matchStrings": [ - "COMPOSE_RULES_VERSION = \"(?.*)\"" - ], - "datasourceTemplate": "maven", - "depNameTemplate": "io.nlopez.compose.rules:detekt", - "registryUrlTemplate": "https://repo1.maven.org/maven2/", - }, { "fileMatch": [ "gradle/libs.versions.toml" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6067f81f..5c34aa90 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,13 +33,6 @@ jobs: gradle-home-cache-cleanup: true cache-read-only: ${{ github.ref != 'refs/heads/main' }} - - name: Run Detekt - uses: gradle/gradle-build-action@6095a76664413da4c8c134ee32e8a8ae900f0f1f # v2.4.0 - with: - arguments: --no-configuration-cache --stacktrace detektMain - gradle-home-cache-cleanup: true - cache-read-only: ${{ github.ref != 'refs/heads/main' }} - - name: (Fail-only) Upload test report if: failure() uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 diff --git a/android/lint-baseline.xml b/android/lint-baseline.xml index 4dc98a15..7089b70f 100644 --- a/android/lint-baseline.xml +++ b/android/lint-baseline.xml @@ -1,4 +1,78 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/api/lint-baseline.xml b/api/lint-baseline.xml index 4c140d8c..0722790e 100644 --- a/api/lint-baseline.xml +++ b/api/lint-baseline.xml @@ -1,4 +1,4 @@ - + diff --git a/build-logic/build.gradle.kts b/build-logic/build.gradle.kts index 09e5daba..e9f38255 100644 --- a/build-logic/build.gradle.kts +++ b/build-logic/build.gradle.kts @@ -81,7 +81,6 @@ gradlePlugin { dependencies { implementation(libs.build.agp) implementation(libs.build.cachefix) - implementation(libs.build.detekt) implementation(libs.build.kotlin.gradle) implementation(libs.build.semver) implementation(libs.build.sentry) diff --git a/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/AndroidCommonPlugin.kt b/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/AndroidCommonPlugin.kt index f33c1c24..1d8643b5 100644 --- a/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/AndroidCommonPlugin.kt +++ b/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/AndroidCommonPlugin.kt @@ -18,9 +18,11 @@ import org.gradle.android.AndroidCacheFixPlugin import org.gradle.api.JavaVersion import org.gradle.api.Plugin import org.gradle.api.Project +import org.gradle.api.artifacts.VersionCatalogsExtension import org.gradle.kotlin.dsl.apply import org.gradle.kotlin.dsl.configure import org.gradle.kotlin.dsl.findByType +import org.gradle.kotlin.dsl.getByType class AndroidCommonPlugin : Plugin { @@ -61,6 +63,9 @@ class AndroidCommonPlugin : Plugin { } project.extensions.findByType()?.run { lint.configureLint(project) } project.extensions.findByType()?.run { lint.configureLint(project) } + val catalog = project.extensions.getByType() + val libs = catalog.named("libs") + project.dependencies.addProvider("lintChecks", libs.findLibrary("slack-compose-lints").get()) } } @@ -69,6 +74,7 @@ private fun Lint.configureLint(project: Project) { checkReleaseBuilds = false warningsAsErrors = false disable.add("DialogFragmentCallbacksDetector") + error.add("ComposeM2Api") baseline = project.file("lint-baseline.xml") } diff --git a/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/DependencyUpdatesPlugin.kt b/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/DependencyUpdatesPlugin.kt index 3d74af16..9cc229fa 100644 --- a/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/DependencyUpdatesPlugin.kt +++ b/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/DependencyUpdatesPlugin.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2022 Harsh Shandilya. + * Copyright © 2022-2023 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. diff --git a/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/Detekt.kt b/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/Detekt.kt deleted file mode 100644 index 4cb66f01..00000000 --- a/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/Detekt.kt +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright © 2022-2023 Harsh Shandilya. - * Use of this source code is governed by an MIT-style - * license that can be found in the LICENSE file or at - * https://opensource.org/licenses/MIT. - */ -package dev.msfjarvis.claw.gradle - -import io.gitlab.arturbosch.detekt.DetektPlugin -import io.gitlab.arturbosch.detekt.extensions.DetektExtension -import org.gradle.api.Project -import org.gradle.kotlin.dsl.configure - -object Detekt { - private const val COMPOSE_RULES_VERSION = "0.1.2" - - fun apply(project: Project) { - project.pluginManager.apply(DetektPlugin::class.java) - project.extensions.configure { - debug = project.providers.gradleProperty("debugDetekt").isPresent - parallel = true - ignoredBuildTypes = listOf("benchmark", "release") - basePath = project.layout.projectDirectory.toString() - baseline = - project.rootProject.layout.projectDirectory - .dir("detekt-baselines") - .file("${project.name}.xml") - .asFile - } - project.dependencies.add( - "detektPlugins", - "io.nlopez.compose.rules:detekt:$COMPOSE_RULES_VERSION", - ) - } -} diff --git a/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/KotlinCommonPlugin.kt b/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/KotlinCommonPlugin.kt index dbc619af..cbc11cc5 100644 --- a/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/KotlinCommonPlugin.kt +++ b/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/KotlinCommonPlugin.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2022 Harsh Shandilya. + * Copyright © 2022-2023 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. @@ -19,7 +19,6 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile class KotlinCommonPlugin : Plugin { override fun apply(project: Project) { - Detekt.apply(project) project.tasks.run { withType().configureEach { sourceCompatibility = JavaVersion.VERSION_11.toString() diff --git a/common/lint-baseline.xml b/common/lint-baseline.xml index 4c140d8c..d6d3acb2 100644 --- a/common/lint-baseline.xml +++ b/common/lint-baseline.xml @@ -1,4 +1,15 @@ - + + + + + diff --git a/config/detekt/detekt.yml b/config/detekt/detekt.yml deleted file mode 100644 index 1381dce8..00000000 --- a/config/detekt/detekt.yml +++ /dev/null @@ -1,733 +0,0 @@ -build: - maxIssues: 0 - excludeCorrectable: false - weights: - # complexity: 2 - # LongParameterList: 1 - # style: 1 - # comments: 1 - -config: - validation: true - warningsAsErrors: false - # 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 - exclude: - - 'ProjectStatisticsReport' - - 'ComplexityReport' - - 'NotificationReport' - - 'FindingsReport' - - 'FileBasedFindingsReport' - # - 'LiteFindingsReport' - -output-reports: - active: true - exclude: - # - 'TxtOutputReport' - # - 'XmlOutputReport' - # - 'HtmlOutputReport' - # - 'MdOutputReport' - -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<])|([.?!:]$)' - KDocReferencesNonPublicProperty: - active: false - excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] - OutdatedDocumentation: - active: false - matchTypeParameters: true - matchDeclarationsOrder: true - allowParamOnConstructorProperties: false - 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 - CognitiveComplexMethod: - active: false - threshold: 15 - ComplexCondition: - active: true - threshold: 4 - ComplexInterface: - active: false - threshold: 10 - includeStaticDeclarations: false - includePrivateDeclarations: 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/**', '**/jsTest/**', '**/iosTest/**'] - threshold: 3 - ignoreAnnotation: true - excludeStringsWithLessThan5Characters: true - ignoreStringsRegex: '$^' - TooManyFunctions: - active: true - excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] - thresholdInFiles: 15 - thresholdInClasses: 15 - thresholdInInterfaces: 15 - thresholdInObjects: 15 - thresholdInEnums: 15 - ignoreDeprecated: false - ignorePrivate: false - ignoreOverridden: false - -coroutines: - active: true - GlobalCoroutineUsage: - active: false - InjectDispatcher: - active: true - dispatcherNames: - - 'IO' - - 'Default' - - 'Unconfined' - RedundantSuspendModifier: - active: true - SleepInsteadOfDelay: - active: true - 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/**', '**/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/**', '**/jsTest/**', '**/iosTest/**'] - exceptions: - - 'ArrayIndexOutOfBoundsException' - - 'Exception' - - 'IllegalArgumentException' - - 'IllegalMonitorStateException' - - 'IllegalStateException' - - 'IndexOutOfBoundsException' - - 'NullPointerException' - - 'RuntimeException' - - 'Throwable' - ThrowingNewInstanceOfSameException: - active: true - TooGenericExceptionCaught: - active: true - excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/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)' - ignoreOverridden: true - 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: '$^' - ignoreOverridden: true - 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/**', '**/jsTest/**', '**/iosTest/**'] - functionPattern: '[a-z][a-zA-Z0-9]*' - excludeClassPattern: '$^' - ignoreOverridden: true - ignoreAnnotated: ['Composable'] - FunctionParameterNaming: - active: true - parameterPattern: '[a-z][A-Za-z0-9]*' - excludeClassPattern: '$^' - ignoreOverridden: true - 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-Za-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: '$^' - ignoreOverridden: true - -performance: - active: true - ArrayPrimitive: - active: true - CouldBeSequence: - active: false - threshold: 3 - 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 - forbiddenTypePatterns: - - 'kotlin.String' - 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 - EqualsAlwaysReturnsTrueOrFalse: - active: true - EqualsWithHashCodeExist: - active: true - ExitOutsideMain: - active: false - ExplicitGarbageCollectionCall: - active: true - HasPlatformType: - active: true - IgnoredReturnValue: - active: true - restrictToConfig: true - returnValueAnnotations: - - '*.CheckResult' - - '*.CheckReturnValue' - ignoreReturnValueAnnotations: - - '*.CanIgnoreReturnValue' - 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/**', '**/jsTest/**', '**/iosTest/**'] - ignoreOnClassesPattern: '' - MapGetWithNotNullAssertionOperator: - active: true - MissingPackageDeclaration: - active: false - excludes: ['**/*.kts'] - NullCheckOnMutableProperty: - active: false - NullableToStringCall: - active: false - UnconditionalJumpStatementInLoop: - active: false - UnnecessaryNotNullOperator: - active: true - UnnecessarySafeCall: - active: true - UnreachableCatchBlock: - active: true - UnreachableCode: - active: true - UnsafeCallOnNullableType: - active: true - excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] - UnsafeCast: - active: true - UnusedUnaryOperator: - active: true - UselessPostfixExpression: - active: true - WrongEqualsTypeParameter: - active: true - -style: - active: true - CanBeNonNullable: - active: false - CascadingCallWrapping: - active: false - includeElvis: true - ClassOrdering: - active: false - CollapsibleIfStatements: - active: false - DataClassContainsFunctions: - active: false - conversionFunctionPrefix: ['to'] - DataClassShouldBeImmutable: - active: false - DestructuringDeclarationWithTooManyEntries: - active: true - maxDestructuringEntries: 3 - EqualsNullCall: - active: true - EqualsOnSignatureLine: - active: false - ExplicitCollectionElementAccessMethod: - active: false - ExplicitItLambdaParameter: - active: true - ExpressionBodySyntax: - active: false - includeLineWrapping: false - ForbiddenComment: - active: true - values: - - 'FIXME:' - - 'STOPSHIP:' - - 'TODO:' - allowedPatterns: '' - customMessage: '' - ForbiddenImport: - active: false - imports: [] - forbiddenPatterns: '' - ForbiddenMethodCall: - active: false - methods: - - 'kotlin.io.print' - - '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/**', '**/jsTest/**', '**/iosTest/**', '**/*.kts'] - ignoreNumbers: - - '-1' - - '0' - - '1' - - '2' - ignoreHashCodeFunction: true - ignorePropertyDeclaration: true - ignoreLocalVariableDeclaration: false - ignoreConstantDeclaration: true - ignoreCompanionObjectPropertyDeclaration: true - ignoreAnnotation: false - ignoreNamedArgument: true - ignoreEnums: false - ignoreRanges: false - ignoreExtensionFunctions: true - MandatoryBracesIfStatements: - active: false - MandatoryBracesLoops: - active: false - MaxChainedCallsOnSameLine: - active: false - maxChainedCalls: 5 - MaxLineLength: - active: true - maxLineLength: 120 - excludePackageStatements: true - excludeImportStatements: true - excludeCommentStatements: false - MayBeConst: - active: true - ModifierOrder: - active: true - MultilineLambdaItParameter: - active: false - NestedClassesVisibility: - active: true - NewLineAtEndOfFile: - active: true - NoTabs: - active: false - NullableBooleanCheck: - active: false - ObjectLiteralToLambda: - active: true - OptionalAbstractKeyword: - active: true - OptionalUnit: - active: false - OptionalWhenBraces: - 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 - ThrowsCount: - active: true - max: 2 - excludeGuardClauses: false - TrailingWhitespace: - active: false - UnderscoresInNumericLiterals: - active: false - acceptableLength: 4 - allowNonStandardGrouping: false - UnnecessaryAbstractClass: - active: true - UnnecessaryAnnotationUseSiteTarget: - active: false - UnnecessaryApply: - active: true - UnnecessaryBackticks: - active: false - UnnecessaryFilter: - active: true - UnnecessaryInheritance: - active: true - UnnecessaryInnerClass: - active: false - UnnecessaryLet: - active: false - UnnecessaryParentheses: - active: false - UntilInsteadOfRangeTo: - active: false - UnusedImports: - active: false - UnusedPrivateClass: - active: true - UnusedPrivateMember: - active: true - allowedNames: '(_|ignored|expected|serialVersionUID)' - ignoreAnnotated: ['Preview'] - 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 - UseIsNullOrEmpty: - active: true - UseOrEmpty: - active: true - UseRequire: - active: true - UseRequireNotNull: - active: true - UselessCallOnNotNull: - active: true - UtilityClassWithPublicConstructor: - active: true - VarCouldBeVal: - active: true - ignoreLateinitVar: false - WildcardImport: - active: true - excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] - excludeImports: - - 'java.util.*' - -Compose: - CompositionLocalAllowlist: - active: true - # allowedCompositionLocals: LocalSomething,LocalSomethingElse - ContentEmitterReturningValues: - active: true - # contentEmitters: MyComposable,MyOtherComposable - ModifierComposable: - active: true - ModifierMissing: - active: true - ModifierReused: - active: true - ModifierWithoutDefault: - active: true - MultipleEmitters: - active: true - # contentEmitters: MyComposable,MyOtherComposable - MutableParams: - active: true - ComposableNaming: - active: true - ComposableParamOrder: - active: true - PreviewNaming: - active: true - PreviewPublic: - active: true - RememberMissing: - active: true - ViewModelForwarding: - active: true - ViewModelInjection: - active: true diff --git a/core/build.gradle.kts b/core/build.gradle.kts index c52ee2ee..1300672d 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright © 2022 Harsh Shandilya. + * Copyright © 2022-2023 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. diff --git a/core/lint-baseline.xml b/core/lint-baseline.xml index 4c140d8c..0722790e 100644 --- a/core/lint-baseline.xml +++ b/core/lint-baseline.xml @@ -1,4 +1,4 @@ - + diff --git a/database/lint-baseline.xml b/database/lint-baseline.xml index 4c140d8c..0722790e 100644 --- a/database/lint-baseline.xml +++ b/database/lint-baseline.xml @@ -1,4 +1,4 @@ - + diff --git a/detekt-baselines/android.xml b/detekt-baselines/android.xml deleted file mode 100644 index f6e20e8d..00000000 --- a/detekt-baselines/android.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - LongMethod:LobstersApp.kt$@OptIn( ExperimentalComposeUiApi::class, ExperimentalMaterial3Api::class, ) @Composable fun LobstersApp( urlLauncher: UrlLauncher, htmlConverter: HTMLConverter, setWebUri: (String?) -> Unit, modifier: Modifier = Modifier, viewModel: ClawViewModel = injectedViewModel(), ) - - diff --git a/detekt-baselines/model.xml b/detekt-baselines/model.xml deleted file mode 100644 index 8cb5e9f7..00000000 --- a/detekt-baselines/model.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - MemberNameEqualsClassName:Tags.kt$Tags$private val tags = arrayListOf<String>() - - diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 98009889..e80c0cb8 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -48,7 +48,6 @@ androidx-test-uiautomator = "androidx.test.uiautomator:uiautomator:2.3.0-alpha02 androidx-work-runtime-ktx = { module = "androidx.work:work-runtime-ktx", version.ref = "workmanager" } build-agp = { module = "com.android.tools.build:gradle", version.ref = "agp" } build-cachefix = "org.gradle.android.cache-fix:org.gradle.android.cache-fix.gradle.plugin:2.7.0" -build-detekt = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.22.0" build-kotlin-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } build-semver = "com.vdurmont:semver4j:3.1.0" build-sentry = "io.sentry.android.gradle:io.sentry.android.gradle.gradle.plugin:3.4.2" @@ -80,6 +79,7 @@ okhttp-loggingInterceptor = { module = "com.squareup.okhttp3:logging-interceptor retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" } retrofit-kotlinxSerializationConverter = "com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:0.8.0" sentry-bom = { module = "io.sentry:sentry-bom", version.ref = "sentry-sdk" } +slack-compose-lints = "com.slack.lint.compose:compose-lint-checks:1.1.0" sqldelight-androidDriver = { module = "app.cash.sqldelight:android-driver", version.ref = "sqldelight" } sqldelight-extensions-coroutines = { module = "app.cash.sqldelight:coroutines-extensions-jvm", version.ref = "sqldelight" } sqldelight-jvmDriver = { module = "app.cash.sqldelight:sqlite-driver", version.ref = "sqldelight" } diff --git a/metadata-extractor/build.gradle.kts b/metadata-extractor/build.gradle.kts index ac8402d8..e9dfa1b8 100644 --- a/metadata-extractor/build.gradle.kts +++ b/metadata-extractor/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright © 2022 Harsh Shandilya. + * Copyright © 2022-2023 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT.