Merge pull request #967 from vector-im/feature/bma/detektConfig

Update detekt config.
This commit is contained in:
Benoit Marty 2023-07-28 16:47:26 +02:00 committed by GitHub
commit d06f86f79d
90 changed files with 296 additions and 198 deletions

View file

@ -1,6 +1,21 @@
# Default rules: https://github.com/detekt/detekt/blob/main/detekt-core/src/main/resources/default-detekt-config.yml
style:
AlsoCouldBeApply:
active: true
CascadingCallWrapping:
active: true
includeElvis: true
DataClassShouldBeImmutable:
active: true
EqualsNullCall:
active: true
EqualsOnSignatureLine:
active: true
ExplicitCollectionElementAccessMethod:
active: true
ExplicitItLambdaParameter:
active: true
MaxLineLength:
# Default is 120
maxLineLength: 160
@ -9,7 +24,7 @@ style:
ReturnCount:
active: false
UnnecessaryAbstractClass:
active: false
active: true
FunctionOnlyReturningConstant:
active: false
UnusedPrivateMember:
@ -32,23 +47,94 @@ style:
ThrowsCount:
active: false
LoopWithTooManyJumpStatements:
active: false
active: true
SerialVersionUIDInSerializableClass:
active: false
ProtectedMemberInFinalClass:
active: false
active: true
UseCheckOrError:
active: true
OptionalUnit:
active: true
PreferToOverPairSyntax:
active: true
RedundantExplicitType:
active: true
TrailingWhitespace:
active: true
TrimMultilineRawString:
active: true
trimmingMethods:
- 'trimIndent'
- 'trimMargin'
UnderscoresInNumericLiterals:
active: true
acceptableLength: 4
allowNonStandardGrouping: false
UnnecessaryAnnotationUseSiteTarget:
active: true
UnnecessaryBackticks:
active: true
UnnecessaryBracesAroundTrailingLambda:
active: true
UseDataClass:
active: true
allowVars: false
UseEmptyCounterpart:
active: true
UseIfEmptyOrIfBlank:
active: true
UseLet:
active: true
UseSumOfInsteadOfFlatMapSize:
active: true
coroutines:
GlobalCoroutineUsage:
# Keep false for now.
active: false
SuspendFunSwallowedCancellation:
active: true
SuspendFunWithCoroutineScopeReceiver:
active: true
empty-blocks:
EmptyFunctionBlock:
active: false
EmptySecondaryConstructor:
active: false
active: true
potential-bugs:
ImplicitDefaultLocale:
active: false
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:
@ -56,11 +142,13 @@ exceptions:
SwallowedException:
active: false
ThrowingExceptionsWithoutMessageOrCause:
active: false
active: true
TooGenericExceptionThrown:
active: false
active: true
InstanceOfCheckForException:
active: false
active: true
ObjectExtendsThrowable:
active: true
complexity:
TooManyFunctions:
@ -74,9 +162,9 @@ complexity:
NestedBlockDepth:
active: false
ComplexCondition:
active: false
active: true
LargeClass:
active: false
active: true
naming:
VariableNaming:
@ -86,10 +174,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:
@ -149,7 +247,7 @@ Compose:
PreviewNaming:
active: true
PreviewPublic:
active: false
active: true
# You can optionally disable that only previews with @PreviewParameter are flagged
previewPublicOnlyIfParams: false
RememberMissing: