Enable more detekt rules and remove unused extension.

This commit is contained in:
Benoit Marty
2023-07-26 11:23:05 +02:00
committed by Benoit Marty
parent 8458a9e937
commit 4ba4bd1f56
2 changed files with 48 additions and 4 deletions

View File

@@ -72,7 +72,3 @@ fun String.ellipsize(length: Int): String {
return "${this.take(length)}"
}
inline fun <reified R> Any?.takeAs(): R? {
return takeIf { it is R } as R?
}

View File

@@ -8,6 +8,14 @@ style:
includeElvis: true
DataClassShouldBeImmutable:
active: true
EqualsNullCall:
active: true
EqualsOnSignatureLine:
active: true
ExplicitCollectionElementAccessMethod:
active: true
ExplicitItLambdaParameter:
active: true
MaxLineLength:
# Default is 120
maxLineLength: 160
@@ -65,6 +73,34 @@ empty-blocks:
potential-bugs:
ImplicitDefaultLocale:
active: true
CastNullableToNonNullableType:
active: true
CastToNullableType:
active: true
Deprecation:
active: true
DontDowncastCollectionTypes:
active: true
ElseCaseInsteadOfExhaustiveWhen:
active: true
ExitOutsideMain:
active: true
ImplicitUnitReturnType:
active: true
allowExplicitReturnType: false
MissingPackageDeclaration:
active: true
excludes: ['**/*.kts']
NullCheckOnMutableProperty:
active: true
NullableToStringCall:
active: true
PropertyUsedBeforeDeclaration:
active: true
UnconditionalJumpStatementInLoop:
active: true
UnnecessaryNotNullCheck:
active: true
exceptions:
TooGenericExceptionCaught:
@@ -77,6 +113,8 @@ exceptions:
active: true
InstanceOfCheckForException:
active: true
ObjectExtendsThrowable:
active: true
complexity:
TooManyFunctions:
@@ -102,10 +140,20 @@ naming:
FunctionNaming:
active: true
ignoreAnnotated: ['Composable']
LambdaParameterNaming:
active: true
NonBooleanPropertyPrefixedWithIs:
active: true
VariableMaxLength:
active: true
performance:
SpreadOperator:
active: false
CouldBeSequence:
active: true
UnnecessaryPartOfBinaryExpression:
active: true
# Note: all rules for `comments` are disabled by default, but I put them here to be aware of their existence
comments: