From 46de2d39bc4a0c44f7f7781d5ed6a70f218c24bf Mon Sep 17 00:00:00 2001 From: Vitor Hugo Schwaab Date: Tue, 2 Apr 2024 14:28:31 +0200 Subject: [PATCH] chore: update detekt rules --- .../main/kotlin/scripts/quality.gradle.kts | 3 +- config/detekt/detekt.yml | 42 ++++++++----------- kalium | 2 +- 3 files changed, 21 insertions(+), 26 deletions(-) diff --git a/buildSrc/src/main/kotlin/scripts/quality.gradle.kts b/buildSrc/src/main/kotlin/scripts/quality.gradle.kts index 92a7c06944a..4ca42df005a 100644 --- a/buildSrc/src/main/kotlin/scripts/quality.gradle.kts +++ b/buildSrc/src/main/kotlin/scripts/quality.gradle.kts @@ -32,7 +32,8 @@ dependencies { val detektVersion = findVersion("detekt").requiredVersion detekt("io.gitlab.arturbosch.detekt:detekt-cli:$detektVersion") detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:$detektVersion") - detektPlugins("com.wire:detekt-rules:1.0.0-SNAPSHOT") { + detektPlugins("io.gitlab.arturbosch.detekt:detekt-rules-libraries:$detektVersion") + detektPlugins("com.wire:detekt-rules:1.0.0-1.23.6") { isChanging = true } } diff --git a/config/detekt/detekt.yml b/config/detekt/detekt.yml index 7d9834c7597..091f651f4e4 100644 --- a/config/detekt/detekt.yml +++ b/config/detekt/detekt.yml @@ -65,7 +65,7 @@ complexity: threshold: 10 includeStaticDeclarations: false includePrivateDeclarations: false - ComplexMethod: + CyclomaticComplexMethod: active: true threshold: 15 ignoreSingleWhenExpression: false @@ -337,7 +337,6 @@ naming: parameterPattern: '[a-z][A-Za-z0-9]*' privateParameterPattern: '[a-z][A-Za-z0-9]*' excludeClassPattern: '$^' - ignoreOverridden: true EnumNaming: active: true excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**' ] @@ -360,13 +359,11 @@ naming: functionPattern: '([a-z][a-zA-Z0-9]*)|(`.*`)' excludeClassPattern: '$^' ignoreAnnotated: [ 'Composable' ] - ignoreOverridden: true FunctionParameterNaming: active: true excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**' ] parameterPattern: '[a-z][A-Za-z0-9]*' excludeClassPattern: '$^' - ignoreOverridden: true InvalidPackageDeclaration: active: false rootPackage: '' @@ -406,7 +403,6 @@ naming: variablePattern: '[a-z][A-Za-z0-9]*' privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*' excludeClassPattern: '$^' - ignoreOverridden: true performance: active: true @@ -425,8 +421,6 @@ potential-bugs: active: true Deprecation: active: false - DuplicateCaseInWhenExpression: - active: true EqualsAlwaysReturnsTrueOrFalse: active: true EqualsWithHashCodeExist: @@ -450,10 +444,6 @@ potential-bugs: ignoreOnClassesPattern: '' MapGetWithNotNullAssertionOperator: active: false - MissingWhenCase: - active: true - RedundantElseInWhen: - active: true UnconditionalJumpStatementInLoop: active: false UnnecessaryNotNullOperator: @@ -473,11 +463,15 @@ potential-bugs: style: active: true + BracesOnWhenStatements: + active: false + BracesOnIfStatements: + active: false CollapsibleIfStatements: active: false DataClassContainsFunctions: active: false - conversionFunctionPrefix: 'to' + conversionFunctionPrefix: ['to'] DataClassShouldBeImmutable: active: false EqualsNullCall: @@ -493,7 +487,7 @@ style: includeLineWrapping: false ForbiddenComment: active: false - values: [ 'TODO:', 'FIXME:', 'STOPSHIP:' ] + comments: [ 'TODO:', 'FIXME:', 'STOPSHIP:' ] allowedPatterns: '' ForbiddenImport: active: false @@ -502,9 +496,6 @@ style: ForbiddenMethodCall: active: false methods: [ ] - ForbiddenPublicDataClass: - active: false - ignorePackages: [ '*.internal', '*.internal.*' ] ForbiddenVoid: active: false ignoreOverridden: false @@ -512,10 +503,8 @@ style: FunctionOnlyReturningConstant: active: true ignoreOverridableFunction: true - excludedFunctions: 'describeContents, empty' + excludedFunctions: ['describeContents', 'empty'] excludeAnnotatedFunction: [ 'dagger.Provides' ] - LibraryCodeMustSpecifyReturnType: - active: true LoopWithTooManyJumpStatements: active: true maxJumpCount: 1 @@ -533,8 +522,6 @@ style: ignoreNamedArgument: true ignoreEnums: false ignoreRanges: false - MandatoryBracesIfStatements: - active: false MandatoryBracesLoops: active: false MaxLineLength: @@ -557,8 +544,6 @@ style: active: true OptionalUnit: active: false - OptionalWhenBraces: - active: false PreferToOverPairSyntax: active: false ProtectedMemberInFinalClass: @@ -570,7 +555,7 @@ style: ReturnCount: active: true max: 2 - excludedFunctions: 'equals' + excludedFunctions: ['equals'] excludeLabeled: false excludeReturnFromLambda: true excludeGuardClauses: false @@ -633,4 +618,13 @@ style: excludes: [ '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**' ] excludeImports: [ 'java.util.*', 'kotlinx.android.synthetic.*' ] +libraries: + ForbiddenPublicDataClass: + active: false + ignorePackages: [ '*.internal', '*.internal.*' ] + LibraryCodeMustSpecifyReturnType: + active: true + LibraryEntitiesShouldNotBePublic: + active: false + WireRuleSet: diff --git a/kalium b/kalium index 36bb434bd71..5afbc8bdd41 160000 --- a/kalium +++ b/kalium @@ -1 +1 @@ -Subproject commit 36bb434bd71b2491315a5e780b1e68fc50b11a84 +Subproject commit 5afbc8bdd41d8f32d20a04b29349d238685e0433