Enable more detekt rules and remove unused extension.
This commit is contained in:
parent
8458a9e937
commit
4ba4bd1f56
2 changed files with 48 additions and 4 deletions
|
|
@ -72,7 +72,3 @@ fun String.ellipsize(length: Int): String {
|
||||||
|
|
||||||
return "${this.take(length)}…"
|
return "${this.take(length)}…"
|
||||||
}
|
}
|
||||||
|
|
||||||
inline fun <reified R> Any?.takeAs(): R? {
|
|
||||||
return takeIf { it is R } as R?
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,14 @@ style:
|
||||||
includeElvis: true
|
includeElvis: true
|
||||||
DataClassShouldBeImmutable:
|
DataClassShouldBeImmutable:
|
||||||
active: true
|
active: true
|
||||||
|
EqualsNullCall:
|
||||||
|
active: true
|
||||||
|
EqualsOnSignatureLine:
|
||||||
|
active: true
|
||||||
|
ExplicitCollectionElementAccessMethod:
|
||||||
|
active: true
|
||||||
|
ExplicitItLambdaParameter:
|
||||||
|
active: true
|
||||||
MaxLineLength:
|
MaxLineLength:
|
||||||
# Default is 120
|
# Default is 120
|
||||||
maxLineLength: 160
|
maxLineLength: 160
|
||||||
|
|
@ -65,6 +73,34 @@ empty-blocks:
|
||||||
potential-bugs:
|
potential-bugs:
|
||||||
ImplicitDefaultLocale:
|
ImplicitDefaultLocale:
|
||||||
active: true
|
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:
|
exceptions:
|
||||||
TooGenericExceptionCaught:
|
TooGenericExceptionCaught:
|
||||||
|
|
@ -77,6 +113,8 @@ exceptions:
|
||||||
active: true
|
active: true
|
||||||
InstanceOfCheckForException:
|
InstanceOfCheckForException:
|
||||||
active: true
|
active: true
|
||||||
|
ObjectExtendsThrowable:
|
||||||
|
active: true
|
||||||
|
|
||||||
complexity:
|
complexity:
|
||||||
TooManyFunctions:
|
TooManyFunctions:
|
||||||
|
|
@ -102,10 +140,20 @@ naming:
|
||||||
FunctionNaming:
|
FunctionNaming:
|
||||||
active: true
|
active: true
|
||||||
ignoreAnnotated: ['Composable']
|
ignoreAnnotated: ['Composable']
|
||||||
|
LambdaParameterNaming:
|
||||||
|
active: true
|
||||||
|
NonBooleanPropertyPrefixedWithIs:
|
||||||
|
active: true
|
||||||
|
VariableMaxLength:
|
||||||
|
active: true
|
||||||
|
|
||||||
performance:
|
performance:
|
||||||
SpreadOperator:
|
SpreadOperator:
|
||||||
active: false
|
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
|
# Note: all rules for `comments` are disabled by default, but I put them here to be aware of their existence
|
||||||
comments:
|
comments:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue