Skip to content

Commit

Permalink
chore: update detekt rules
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorhugods committed Apr 2, 2024
1 parent 6f53ebe commit 46de2d3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 26 deletions.
3 changes: 2 additions & 1 deletion buildSrc/src/main/kotlin/scripts/quality.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
42 changes: 18 additions & 24 deletions config/detekt/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ complexity:
threshold: 10
includeStaticDeclarations: false
includePrivateDeclarations: false
ComplexMethod:
CyclomaticComplexMethod:
active: true
threshold: 15
ignoreSingleWhenExpression: false
Expand Down Expand Up @@ -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/**' ]
Expand All @@ -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: ''
Expand Down Expand Up @@ -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
Expand All @@ -425,8 +421,6 @@ potential-bugs:
active: true
Deprecation:
active: false
DuplicateCaseInWhenExpression:
active: true
EqualsAlwaysReturnsTrueOrFalse:
active: true
EqualsWithHashCodeExist:
Expand All @@ -450,10 +444,6 @@ potential-bugs:
ignoreOnClassesPattern: ''
MapGetWithNotNullAssertionOperator:
active: false
MissingWhenCase:
active: true
RedundantElseInWhen:
active: true
UnconditionalJumpStatementInLoop:
active: false
UnnecessaryNotNullOperator:
Expand All @@ -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:
Expand All @@ -493,7 +487,7 @@ style:
includeLineWrapping: false
ForbiddenComment:
active: false
values: [ 'TODO:', 'FIXME:', 'STOPSHIP:' ]
comments: [ 'TODO:', 'FIXME:', 'STOPSHIP:' ]
allowedPatterns: ''
ForbiddenImport:
active: false
Expand All @@ -502,20 +496,15 @@ style:
ForbiddenMethodCall:
active: false
methods: [ ]
ForbiddenPublicDataClass:
active: false
ignorePackages: [ '*.internal', '*.internal.*' ]
ForbiddenVoid:
active: false
ignoreOverridden: false
ignoreUsageInGenerics: false
FunctionOnlyReturningConstant:
active: true
ignoreOverridableFunction: true
excludedFunctions: 'describeContents, empty'
excludedFunctions: ['describeContents', 'empty']
excludeAnnotatedFunction: [ 'dagger.Provides' ]
LibraryCodeMustSpecifyReturnType:
active: true
LoopWithTooManyJumpStatements:
active: true
maxJumpCount: 1
Expand All @@ -533,8 +522,6 @@ style:
ignoreNamedArgument: true
ignoreEnums: false
ignoreRanges: false
MandatoryBracesIfStatements:
active: false
MandatoryBracesLoops:
active: false
MaxLineLength:
Expand All @@ -557,8 +544,6 @@ style:
active: true
OptionalUnit:
active: false
OptionalWhenBraces:
active: false
PreferToOverPairSyntax:
active: false
ProtectedMemberInFinalClass:
Expand All @@ -570,7 +555,7 @@ style:
ReturnCount:
active: true
max: 2
excludedFunctions: 'equals'
excludedFunctions: ['equals']
excludeLabeled: false
excludeReturnFromLambda: true
excludeGuardClauses: false
Expand Down Expand Up @@ -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:

0 comments on commit 46de2d3

Please sign in to comment.