Bug 1835190 - Update detekt configs

fenix/115.2.0
Ryan VanderMeulen 1 year ago committed by mergify[bot]
parent ceba00930c
commit 744a091f91

@ -51,6 +51,7 @@ output-reports:
# - 'XmlOutputReport' # - 'XmlOutputReport'
# - 'HtmlOutputReport' # - 'HtmlOutputReport'
# - 'MdOutputReport' # - 'MdOutputReport'
# - 'SarifOutputReport'
comments: comments:
active: true active: true
@ -69,7 +70,7 @@ comments:
endOfSentenceFormat: '([.?!][ \t\n\r\f<])|([.?!:]$)' endOfSentenceFormat: '([.?!][ \t\n\r\f<])|([.?!:]$)'
KDocReferencesNonPublicProperty: KDocReferencesNonPublicProperty:
active: false active: false
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
OutdatedDocumentation: OutdatedDocumentation:
active: false active: false
matchTypeParameters: true matchTypeParameters: true
@ -77,7 +78,7 @@ comments:
allowParamOnConstructorProperties: false allowParamOnConstructorProperties: false
UndocumentedPublicClass: UndocumentedPublicClass:
active: true # Enabled in https://github.com/mozilla-mobile/android-components/issues/76 active: true # Enabled in https://github.com/mozilla-mobile/android-components/issues/76
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
searchInNestedClass: true searchInNestedClass: true
searchInInnerClass: true searchInInnerClass: true
searchInInnerObject: true searchInInnerObject: true
@ -85,11 +86,11 @@ comments:
searchInProtectedClass: false searchInProtectedClass: false
UndocumentedPublicFunction: UndocumentedPublicFunction:
active: true # Enabled in https://github.com/mozilla-mobile/android-components/issues/76 active: true # Enabled in https://github.com/mozilla-mobile/android-components/issues/76
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
searchProtectedFunction: false searchProtectedFunction: false
UndocumentedPublicProperty: UndocumentedPublicProperty:
active: false active: false
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
searchProtectedProperty: false searchProtectedProperty: false
complexity: complexity:
@ -161,14 +162,14 @@ complexity:
active: false active: false
StringLiteralDuplication: StringLiteralDuplication:
active: false active: false
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
threshold: 3 threshold: 3
ignoreAnnotation: true ignoreAnnotation: true
excludeStringsWithLessThan5Characters: true excludeStringsWithLessThan5Characters: true
ignoreStringsRegex: '$^' ignoreStringsRegex: '$^'
TooManyFunctions: TooManyFunctions:
active: true active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
thresholdInFiles: 26 # (Default: 11) Increased in https://github.com/mozilla-mobile/android-components/pull/9927 thresholdInFiles: 26 # (Default: 11) Increased in https://github.com/mozilla-mobile/android-components/pull/9927
thresholdInClasses: 26 # (Default: 11) Increased in https://github.com/mozilla-mobile/android-components/pull/9927 thresholdInClasses: 26 # (Default: 11) Increased in https://github.com/mozilla-mobile/android-components/pull/9927
thresholdInInterfaces: 26 # (Default: 11) Increased in https://github.com/mozilla-mobile/android-components/pull/9927 thresholdInInterfaces: 26 # (Default: 11) Increased in https://github.com/mozilla-mobile/android-components/pull/9927
@ -192,6 +193,8 @@ coroutines:
active: false # (Default: true) active: false # (Default: true)
SleepInsteadOfDelay: SleepInsteadOfDelay:
active: false # (Default: true) active: false # (Default: true)
SuspendFunSwallowedCancellation:
active: false
SuspendFunWithCoroutineScopeReceiver: SuspendFunWithCoroutineScopeReceiver:
active: false active: false
SuspendFunWithFlowReturnType: SuspendFunWithFlowReturnType:
@ -243,7 +246,7 @@ exceptions:
- 'toString' - 'toString'
InstanceOfCheckForException: InstanceOfCheckForException:
active: false # (Default: true) active: false # (Default: true)
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
NotImplementedDeclaration: NotImplementedDeclaration:
active: false active: false
ObjectExtendsThrowable: ObjectExtendsThrowable:
@ -269,7 +272,7 @@ exceptions:
active: false active: false
ThrowingExceptionsWithoutMessageOrCause: ThrowingExceptionsWithoutMessageOrCause:
active: false # (Default: true) active: false # (Default: true)
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
exceptions: exceptions:
- 'ArrayIndexOutOfBoundsException' - 'ArrayIndexOutOfBoundsException'
- 'Exception' - 'Exception'
@ -284,7 +287,7 @@ exceptions:
active: true active: true
TooGenericExceptionCaught: TooGenericExceptionCaught:
active: true active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
exceptionNames: exceptionNames:
- 'ArrayIndexOutOfBoundsException' - 'ArrayIndexOutOfBoundsException'
- 'Error' - 'Error'
@ -308,7 +311,6 @@ naming:
BooleanPropertyNaming: BooleanPropertyNaming:
active: false active: false
allowedPattern: '^(is|has|are)' allowedPattern: '^(is|has|are)'
ignoreOverridden: true
ClassNaming: ClassNaming:
active: true active: true
classPattern: '[A-Z][a-zA-Z0-9]*' classPattern: '[A-Z][a-zA-Z0-9]*'
@ -317,7 +319,6 @@ naming:
parameterPattern: '[a-z][A-Za-z0-9]*' parameterPattern: '[a-z][A-Za-z0-9]*'
privateParameterPattern: '[a-z][A-Za-z0-9]*' privateParameterPattern: '[a-z][A-Za-z0-9]*'
excludeClassPattern: '$^' excludeClassPattern: '$^'
ignoreOverridden: true
EnumNaming: EnumNaming:
active: true active: true
enumEntryPattern: '[A-Z][_a-zA-Z0-9]*' enumEntryPattern: '[A-Z][_a-zA-Z0-9]*'
@ -332,16 +333,14 @@ naming:
minimumFunctionNameLength: 3 minimumFunctionNameLength: 3
FunctionNaming: FunctionNaming:
active: true active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
functionPattern: '[a-z][a-zA-Z0-9]*' functionPattern: '[a-z][a-zA-Z0-9]*'
excludeClassPattern: '$^' excludeClassPattern: '$^'
ignoreOverridden: true
ignoreAnnotated: ['Composable'] # Configuration for Compose https://github.com/mozilla-mobile/android-components/issues/11866 ignoreAnnotated: ['Composable'] # Configuration for Compose https://github.com/mozilla-mobile/android-components/issues/11866
FunctionParameterNaming: FunctionParameterNaming:
active: true active: true
parameterPattern: '[a-z][A-Za-z0-9]*' parameterPattern: '[a-z][A-Za-z0-9]*'
excludeClassPattern: '$^' excludeClassPattern: '$^'
ignoreOverridden: true
InvalidPackageDeclaration: InvalidPackageDeclaration:
active: false # (Default: true) active: false # (Default: true)
rootPackage: '' rootPackage: ''
@ -383,7 +382,6 @@ naming:
variablePattern: '[a-z][A-Za-z0-9]*' variablePattern: '[a-z][A-Za-z0-9]*'
privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*' privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*'
excludeClassPattern: '$^' excludeClassPattern: '$^'
ignoreOverridden: true
performance: performance:
active: true active: true
@ -394,10 +392,10 @@ performance:
threshold: 3 threshold: 3
ForEachOnRange: ForEachOnRange:
active: true active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
SpreadOperator: SpreadOperator:
active: true active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
UnnecessaryPartOfBinaryExpression: UnnecessaryPartOfBinaryExpression:
active: false active: false
UnnecessaryTemporaryInstantiation: UnnecessaryTemporaryInstantiation:
@ -409,6 +407,8 @@ potential-bugs:
active: false # (Default: true) active: false # (Default: true)
forbiddenTypePatterns: forbiddenTypePatterns:
- 'kotlin.String' - 'kotlin.String'
CastNullableToNonNullableType:
active: false
CastToNullableType: CastToNullableType:
active: false active: false
Deprecation: Deprecation:
@ -428,6 +428,7 @@ potential-bugs:
- 'java.util.HashMap' - 'java.util.HashMap'
ElseCaseInsteadOfExhaustiveWhen: ElseCaseInsteadOfExhaustiveWhen:
active: false active: false
ignoredSubjectTypes: []
EqualsAlwaysReturnsTrueOrFalse: EqualsAlwaysReturnsTrueOrFalse:
active: true active: true
EqualsWithHashCodeExist: EqualsWithHashCodeExist:
@ -442,9 +443,12 @@ potential-bugs:
active: false # (Default: true) active: false # (Default: true)
restrictToConfig: true restrictToConfig: true
returnValueAnnotations: returnValueAnnotations:
- 'CheckResult'
- '*.CheckResult' - '*.CheckResult'
- 'CheckReturnValue'
- '*.CheckReturnValue' - '*.CheckReturnValue'
ignoreReturnValueAnnotations: ignoreReturnValueAnnotations:
- 'CanIgnoreReturnValue'
- '*.CanIgnoreReturnValue' - '*.CanIgnoreReturnValue'
returnValueTypes: returnValueTypes:
- 'kotlin.sequences.Sequence' - 'kotlin.sequences.Sequence'
@ -464,7 +468,7 @@ potential-bugs:
active: true active: true
LateinitUsage: LateinitUsage:
active: false active: false
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
ignoreOnClassesPattern: '' ignoreOnClassesPattern: ''
MapGetWithNotNullAssertionOperator: MapGetWithNotNullAssertionOperator:
active: false # (Default: true) active: false # (Default: true)
@ -475,6 +479,8 @@ potential-bugs:
active: false active: false
NullableToStringCall: NullableToStringCall:
active: false active: false
PropertyUsedBeforeDeclaration:
active: false
UnconditionalJumpStatementInLoop: UnconditionalJumpStatementInLoop:
active: false active: false
UnnecessaryNotNullCheck: UnnecessaryNotNullCheck:
@ -489,7 +495,7 @@ potential-bugs:
active: true active: true
UnsafeCallOnNullableType: UnsafeCallOnNullableType:
active: true active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
UnsafeCast: UnsafeCast:
active: true active: true
UnusedUnaryOperator: UnusedUnaryOperator:
@ -503,6 +509,14 @@ style:
active: true active: true
AlsoCouldBeApply: AlsoCouldBeApply:
active: false active: false
BracesOnIfStatements:
active: true # Enabled in https://github.com/mozilla-mobile/android-components/issues/1015
singleLine: 'consistent' # (Default: never)
multiLine: 'always'
BracesOnWhenStatements:
active: false
singleLine: 'necessary'
multiLine: 'consistent'
CanBeNonNullable: CanBeNonNullable:
active: false active: false
CascadingCallWrapping: CascadingCallWrapping:
@ -516,11 +530,22 @@ style:
active: false active: false
conversionFunctionPrefix: conversionFunctionPrefix:
- 'to' - 'to'
allowOperators: false
DataClassShouldBeImmutable: DataClassShouldBeImmutable:
active: false active: false
DestructuringDeclarationWithTooManyEntries: DestructuringDeclarationWithTooManyEntries:
active: false # (Default: true) active: false # (Default: true)
maxDestructuringEntries: 3 maxDestructuringEntries: 3
DoubleNegativeLambda:
active: false
negativeFunctions:
- reason: 'Use `takeIf` instead.'
value: 'takeUnless'
- reason: 'Use `all` instead.'
value: 'none'
negativeFunctionNameParts:
- 'not'
- 'non'
EqualsNullCall: EqualsNullCall:
active: true active: true
EqualsOnSignatureLine: EqualsOnSignatureLine:
@ -532,14 +557,33 @@ style:
ExpressionBodySyntax: ExpressionBodySyntax:
active: false active: false
includeLineWrapping: false includeLineWrapping: false
ForbiddenAnnotation:
active: false
annotations:
- reason: 'it is a java annotation. Use `Suppress` instead.'
value: 'java.lang.SuppressWarnings'
- reason: 'it is a java annotation. Use `kotlin.Deprecated` instead.'
value: 'java.lang.Deprecated'
- reason: 'it is a java annotation. Use `kotlin.annotation.MustBeDocumented` instead.'
value: 'java.lang.annotation.Documented'
- reason: 'it is a java annotation. Use `kotlin.annotation.Target` instead.'
value: 'java.lang.annotation.Target'
- reason: 'it is a java annotation. Use `kotlin.annotation.Retention` instead.'
value: 'java.lang.annotation.Retention'
- reason: 'it is a java annotation. Use `kotlin.annotation.Repeatable` instead.'
value: 'java.lang.annotation.Repeatable'
- reason: 'Kotlin does not support @Inherited annotation, see https://youtrack.jetbrains.com/issue/KT-22265'
value: 'java.lang.annotation.Inherited'
ForbiddenComment: ForbiddenComment:
active: true active: true
values: comments:
- 'FIXME:' - reason: 'Forbidden FIXME todo marker in comment, please fix the problem.'
- 'STOPSHIP:' value: 'FIXME:'
- 'TODO:' - reason: 'Forbidden STOPSHIP todo marker in comment, please address the problem before shipping the code.'
value: 'STOPSHIP:'
- reason: 'Forbidden TODO todo marker in comment, please do the changes.'
value: 'TODO:'
allowedPatterns: '' allowedPatterns: ''
customMessage: ''
ForbiddenImport: ForbiddenImport:
active: false active: false
imports: [] imports: []
@ -568,7 +612,7 @@ style:
maxJumpCount: 1 maxJumpCount: 1
MagicNumber: MagicNumber:
active: true active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**', '**/*.kts'] excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**', '**/*.kts']
ignoreNumbers: ignoreNumbers:
- '-1' - '-1'
- '0' - '0'
@ -584,8 +628,6 @@ style:
ignoreEnums: false ignoreEnums: false
ignoreRanges: false ignoreRanges: false
ignoreExtensionFunctions: true ignoreExtensionFunctions: true
MandatoryBracesIfStatements:
active: true # Enabled in https://github.com/mozilla-mobile/android-components/issues/1015
MandatoryBracesLoops: MandatoryBracesLoops:
active: false active: false
MaxChainedCallsOnSameLine: MaxChainedCallsOnSameLine:
@ -607,6 +649,9 @@ style:
MultilineRawStringIndentation: MultilineRawStringIndentation:
active: false active: false
indentSize: 4 indentSize: 4
trimmingMethods:
- 'trimIndent'
- 'trimMargin'
NestedClassesVisibility: NestedClassesVisibility:
active: true active: true
NewLineAtEndOfFile: NewLineAtEndOfFile:
@ -647,6 +692,10 @@ style:
active: true active: true
SpacingBetweenPackageAndImports: SpacingBetweenPackageAndImports:
active: true # Enabled in https://github.com/mozilla-mobile/android-components/pull/78 active: true # Enabled in https://github.com/mozilla-mobile/android-components/pull/78
StringShouldBeRawString:
active: false
maxEscapedCharacterCount: 2
ignoredCharacters: []
ThrowsCount: ThrowsCount:
active: true active: true
max: 2 max: 2
@ -655,6 +704,9 @@ style:
active: false active: false
TrimMultilineRawString: TrimMultilineRawString:
active: false active: false
trimmingMethods:
- 'trimIndent'
- 'trimMargin'
UnderscoresInNumericLiterals: UnderscoresInNumericLiterals:
active: false active: false
acceptableLength: 4 acceptableLength: 4
@ -667,6 +719,8 @@ style:
active: true active: true
UnnecessaryBackticks: UnnecessaryBackticks:
active: false active: false
UnnecessaryBracesAroundTrailingLambda:
active: false
UnnecessaryFilter: UnnecessaryFilter:
active: false # (Default: true) active: false # (Default: true)
UnnecessaryInheritance: UnnecessaryInheritance:
@ -682,12 +736,18 @@ style:
active: false active: false
UnusedImports: UnusedImports:
active: false active: false
UnusedParameter:
active: true
allowedNames: 'ignored|expected'
UnusedPrivateClass: UnusedPrivateClass:
active: true active: true
UnusedPrivateMember: UnusedPrivateMember:
active: true active: true
allowedNames: '(_|ignored|expected|serialVersionUID)' allowedNames: ''
ignoreAnnotated: ['Composable'] # Configuration for Compose https://github.com/mozilla-mobile/android-components/issues/11866 ignoreAnnotated: ['Composable'] # Configuration for Compose https://github.com/mozilla-mobile/android-components/issues/11866
UnusedPrivateProperty:
active: true
allowedNames: '_|ignored|expected|serialVersionUID'
UseAnyOrNoneInsteadOfFind: UseAnyOrNoneInsteadOfFind:
active: false # (Default: true) active: false # (Default: true)
UseArrayLiteralsInAnnotations: UseArrayLiteralsInAnnotations:
@ -705,8 +765,11 @@ style:
active: false active: false
UseIfInsteadOfWhen: UseIfInsteadOfWhen:
active: false active: false
ignoreWhenContainingVariableDeclaration: false
UseIsNullOrEmpty: UseIsNullOrEmpty:
active: false # (Default: true) active: false # (Default: true)
UseLet:
active: false
UseOrEmpty: UseOrEmpty:
active: true active: true
UseRequire: UseRequire:

Loading…
Cancel
Save