detekt.yml (24669B)
1 # Please refer to https://github.com/mozilla-mobile/firefox-android/blob/main/android-components/config/detekt.yml 2 # for the source of truth for our detekt configuration. 3 4 build: 5 maxIssues: 0 6 excludeCorrectable: false 7 weights: 8 # complexity: 2 9 # LongParameterList: 1 10 # style: 1 11 # comments: 1 12 13 config: 14 validation: true 15 warningsAsErrors: false 16 checkExhaustiveness: false 17 # when writing own rules with new properties, exclude the property path e.g.: 'my_rule_set,.*>.*>[my_property]' 18 excludes: '' 19 20 processors: 21 active: true 22 exclude: 23 - 'DetektProgressListener' 24 # - 'KtFileCountProcessor' 25 # - 'PackageCountProcessor' 26 # - 'ClassCountProcessor' 27 # - 'FunctionCountProcessor' 28 # - 'PropertyCountProcessor' 29 # - 'ProjectComplexityProcessor' 30 # - 'ProjectCognitiveComplexityProcessor' 31 # - 'ProjectLLOCProcessor' 32 # - 'ProjectCLOCProcessor' 33 # - 'ProjectLOCProcessor' 34 # - 'ProjectSLOCProcessor' 35 # - 'LicenseHeaderLoaderExtension' 36 37 console-reports: 38 active: true 39 exclude: 40 # - 'ProjectStatisticsReport' 41 # - 'ComplexityReport' 42 # - 'NotificationReport' 43 # - 'FindingsReport' 44 # - 'FileBasedFindingsReport' 45 # - 'LiteFindingsReport' 46 47 output-reports: 48 active: true 49 exclude: 50 # - 'TxtOutputReport' 51 # - 'XmlOutputReport' 52 # - 'HtmlOutputReport' 53 # - 'MdOutputReport' 54 # - 'SarifOutputReport' 55 56 comments: 57 active: true 58 AbsentOrWrongFileLicense: 59 active: true # Enabled in https://bugzilla.mozilla.org/show_bug.cgi?id=1795140 60 licenseTemplateFile: 'license.template' 61 licenseTemplateIsRegex: false 62 excludes: ['**/generated/**'] 63 CommentOverPrivateFunction: 64 active: false 65 CommentOverPrivateProperty: 66 active: false 67 DeprecatedBlockTag: 68 active: false 69 EndOfSentenceFormat: 70 active: false 71 endOfSentenceFormat: '([.?!][ \t\n\r\f<])|([.?!:]$)' 72 KDocReferencesNonPublicProperty: 73 active: false 74 excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**'] 75 OutdatedDocumentation: 76 active: true # Enabled in https://bugzilla.mozilla.org/show_bug.cgi?id=1848527 77 matchTypeParameters: false # (Default: true) Disabled in https://bugzilla.mozilla.org/show_bug.cgi?id=1848527 78 matchDeclarationsOrder: true 79 allowParamOnConstructorProperties: false 80 UndocumentedPublicClass: 81 active: true # Enabled in https://github.com/mozilla-mobile/android-components/issues/76 82 excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**'] 83 searchInNestedClass: true 84 searchInInnerClass: true 85 searchInInnerObject: true 86 searchInInnerInterface: true 87 searchInProtectedClass: false 88 ignoreDefaultCompanionObject: true 89 UndocumentedPublicFunction: 90 active: true # Enabled in https://github.com/mozilla-mobile/android-components/issues/76 91 excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**'] 92 searchProtectedFunction: false 93 UndocumentedPublicProperty: 94 active: false 95 excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**'] 96 searchProtectedProperty: false 97 98 complexity: 99 active: true 100 CognitiveComplexMethod: 101 active: true 102 threshold: 15 103 ComplexCondition: 104 active: true 105 threshold: 4 106 ComplexInterface: 107 active: false 108 threshold: 10 109 includeStaticDeclarations: false 110 includePrivateDeclarations: false 111 ignoreOverloaded: false 112 CyclomaticComplexMethod: 113 active: true 114 threshold: 18 # (Default: 15) Increased in https://github.com/mozilla-mobile/android-components/pull/10328 115 ignoreSingleWhenExpression: true # Enabled in https://github.com/mozilla-mobile/android-components/pull/3271 116 ignoreSimpleWhenEntries: false 117 ignoreNestingFunctions: false 118 nestingFunctions: 119 - 'also' 120 - 'apply' 121 - 'forEach' 122 - 'isNotNull' 123 - 'ifNull' 124 - 'let' 125 - 'run' 126 - 'use' 127 - 'with' 128 LabeledExpression: 129 active: false 130 ignoredLabels: [] 131 LargeClass: 132 active: true 133 threshold: 600 134 LongMethod: 135 active: true 136 threshold: 75 # (Default: 60) Increased in https://github.com/mozilla-mobile/android-components/issues/6350 137 LongParameterList: 138 active: true 139 functionThreshold: 8 # (Default: 6) Increased in https://bugzilla.mozilla.org/show_bug.cgi?id=1872996 140 constructorThreshold: 7 141 ignoreDefaultParameters: true # Enabled in https://github.com/mozilla-mobile/android-components/issues/10835 142 ignoreDataClasses: true 143 ignoreAnnotatedParameter: [] 144 MethodOverloading: 145 active: false 146 threshold: 6 147 NamedArguments: 148 active: false 149 threshold: 3 150 ignoreArgumentsMatchingNames: false 151 NestedBlockDepth: 152 active: true 153 threshold: 4 154 NestedScopeFunctions: 155 active: false 156 threshold: 1 157 functions: 158 - 'kotlin.apply' 159 - 'kotlin.run' 160 - 'kotlin.with' 161 - 'kotlin.let' 162 - 'kotlin.also' 163 ReplaceSafeCallChainWithRun: 164 active: false 165 StringLiteralDuplication: 166 active: false 167 excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**'] 168 threshold: 3 169 ignoreAnnotation: true 170 excludeStringsWithLessThan5Characters: true 171 ignoreStringsRegex: '$^' 172 TooManyFunctions: 173 active: true 174 excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**'] 175 thresholdInFiles: 26 # (Default: 11) Increased in https://github.com/mozilla-mobile/android-components/pull/9927 176 thresholdInClasses: 26 # (Default: 11) Increased in https://github.com/mozilla-mobile/android-components/pull/9927 177 thresholdInInterfaces: 26 # (Default: 11) Increased in https://github.com/mozilla-mobile/android-components/pull/9927 178 thresholdInObjects: 26 # (Default: 11) Increased in https://github.com/mozilla-mobile/android-components/pull/9927 179 thresholdInEnums: 11 180 ignoreDeprecated: false 181 ignorePrivate: false 182 ignoreOverridden: false 183 ignoreAnnotatedFunctions: [] 184 185 coroutines: 186 active: true 187 GlobalCoroutineUsage: 188 active: false 189 InjectDispatcher: 190 active: false # (Default: true) 191 dispatcherNames: 192 - 'IO' 193 - 'Default' 194 - 'Unconfined' 195 RedundantSuspendModifier: 196 active: false # (Default: true) 197 SleepInsteadOfDelay: 198 active: false # (Default: true) 199 SuspendFunSwallowedCancellation: 200 active: false 201 SuspendFunWithCoroutineScopeReceiver: 202 active: false 203 SuspendFunWithFlowReturnType: 204 active: false # (Default: true) 205 206 empty-blocks: 207 active: true 208 EmptyCatchBlock: 209 active: true 210 allowedExceptionNameRegex: '_|(ignore|expected).*' 211 EmptyClassBlock: 212 active: true 213 EmptyDefaultConstructor: 214 active: true 215 EmptyDoWhileBlock: 216 active: true 217 EmptyElseBlock: 218 active: true 219 EmptyFinallyBlock: 220 active: true 221 EmptyForBlock: 222 active: true 223 EmptyFunctionBlock: 224 active: true 225 ignoreOverridden: false 226 EmptyIfBlock: 227 active: true 228 EmptyInitBlock: 229 active: true 230 EmptyKtFile: 231 active: true 232 EmptySecondaryConstructor: 233 active: true 234 EmptyTryBlock: 235 active: true 236 EmptyWhenBlock: 237 active: true 238 EmptyWhileBlock: 239 active: true 240 241 exceptions: 242 active: true 243 ExceptionRaisedInUnexpectedLocation: 244 active: false # (Default: true) 245 methodNames: 246 - 'equals' 247 - 'finalize' 248 - 'hashCode' 249 - 'toString' 250 InstanceOfCheckForException: 251 active: false # (Default: true) 252 excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**'] 253 NotImplementedDeclaration: 254 active: false 255 ObjectExtendsThrowable: 256 active: false 257 PrintStackTrace: 258 active: true 259 RethrowCaughtException: 260 active: false # (Default: true) 261 ReturnFromFinally: 262 active: true 263 ignoreLabeled: false 264 SwallowedException: 265 active: false # (Default: true) 266 ignoredExceptionTypes: 267 - 'InterruptedException' 268 - 'MalformedURLException' 269 - 'NumberFormatException' 270 - 'ParseException' 271 allowedExceptionNameRegex: '_|(ignore|expected).*' 272 ThrowingExceptionFromFinally: 273 active: true 274 ThrowingExceptionInMain: 275 active: false 276 ThrowingExceptionsWithoutMessageOrCause: 277 active: false # (Default: true) 278 excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**'] 279 exceptions: 280 - 'ArrayIndexOutOfBoundsException' 281 - 'Exception' 282 - 'IllegalArgumentException' 283 - 'IllegalMonitorStateException' 284 - 'IllegalStateException' 285 - 'IndexOutOfBoundsException' 286 - 'NullPointerException' 287 - 'RuntimeException' 288 - 'Throwable' 289 ThrowingNewInstanceOfSameException: 290 active: true 291 TooGenericExceptionCaught: 292 active: true 293 excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**'] 294 exceptionNames: 295 - 'ArrayIndexOutOfBoundsException' 296 - 'Error' 297 - 'Exception' 298 - 'IllegalMonitorStateException' 299 - 'IndexOutOfBoundsException' 300 - 'NullPointerException' 301 - 'RuntimeException' 302 - 'Throwable' 303 allowedExceptionNameRegex: '_|(ignore|expected).*' 304 TooGenericExceptionThrown: 305 active: true 306 exceptionNames: 307 - 'Error' 308 - 'Exception' 309 - 'RuntimeException' 310 - 'Throwable' 311 312 naming: 313 active: true 314 BooleanPropertyNaming: 315 active: false 316 allowedPattern: '^(is|has|are)' 317 ClassNaming: 318 active: true 319 classPattern: '[A-Z][a-zA-Z0-9]*' 320 ConstructorParameterNaming: 321 active: true 322 parameterPattern: '[a-z][A-Za-z0-9]*' 323 privateParameterPattern: '[a-z][A-Za-z0-9]*' 324 excludeClassPattern: '$^' 325 EnumNaming: 326 active: true 327 enumEntryPattern: '[A-Z][_a-zA-Z0-9]*' 328 ForbiddenClassName: 329 active: false 330 forbiddenName: [] 331 FunctionMaxLength: 332 active: false 333 maximumFunctionNameLength: 30 334 FunctionMinLength: 335 active: false 336 minimumFunctionNameLength: 3 337 FunctionNaming: 338 active: true 339 excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**'] 340 functionPattern: '[a-z][a-zA-Z0-9]*' 341 excludeClassPattern: '$^' 342 ignoreAnnotated: ['Composable'] # Configuration for Compose https://github.com/mozilla-mobile/android-components/issues/11866 343 FunctionParameterNaming: 344 active: true 345 parameterPattern: '[a-z][A-Za-z0-9]*' 346 excludeClassPattern: '$^' 347 InvalidPackageDeclaration: 348 active: false # (Default: true) 349 rootPackage: '' 350 requireRootInDeclaration: false 351 LambdaParameterNaming: 352 active: false 353 parameterPattern: '[a-z][A-Za-z0-9]*|_' 354 MatchingDeclarationName: 355 active: true 356 mustBeFirst: true 357 MemberNameEqualsClassName: 358 active: false # (Default: true) 359 ignoreOverridden: true 360 NoNameShadowing: 361 active: false # (Default: true) 362 NonBooleanPropertyPrefixedWithIs: 363 active: false 364 ObjectPropertyNaming: 365 active: true 366 constantPattern: '[A-Za-z][_A-Za-z0-9]*' 367 propertyPattern: '[A-Za-z][_A-Za-z0-9]*' 368 privatePropertyPattern: '(_)?[A-Za-z][_A-Za-z0-9]*' 369 PackageNaming: 370 active: true 371 packagePattern: '[a-z]+(\.[a-z][A-Za-z0-9]*)*' 372 TopLevelPropertyNaming: 373 active: true 374 constantPattern: '[A-Z][_A-Z0-9]*' 375 propertyPattern: '[A-Za-z][_A-Za-z0-9]*' 376 privatePropertyPattern: '_?[A-Za-z][_A-Za-z0-9]*' 377 VariableMaxLength: 378 active: false 379 maximumVariableNameLength: 64 380 VariableMinLength: 381 active: false 382 minimumVariableNameLength: 1 383 VariableNaming: 384 active: true 385 variablePattern: '[a-z][A-Za-z0-9]*' 386 privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*' 387 excludeClassPattern: '$^' 388 389 performance: 390 active: true 391 ArrayPrimitive: 392 active: true 393 CouldBeSequence: 394 active: false 395 threshold: 3 396 ForEachOnRange: 397 active: true 398 excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**'] 399 SpreadOperator: 400 active: true 401 excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**'] 402 UnnecessaryPartOfBinaryExpression: 403 active: false 404 UnnecessaryTemporaryInstantiation: 405 active: true 406 407 potential-bugs: 408 active: true 409 AvoidReferentialEquality: 410 active: false # (Default: true) 411 forbiddenTypePatterns: 412 - 'kotlin.String' 413 CastNullableToNonNullableType: 414 active: false 415 CastToNullableType: 416 active: false 417 Deprecation: 418 active: false 419 DontDowncastCollectionTypes: 420 active: false 421 DoubleMutabilityForCollection: 422 active: true 423 mutableTypes: 424 - 'kotlin.collections.MutableList' 425 - 'kotlin.collections.MutableMap' 426 - 'kotlin.collections.MutableSet' 427 - 'java.util.ArrayList' 428 - 'java.util.LinkedHashSet' 429 - 'java.util.HashSet' 430 - 'java.util.LinkedHashMap' 431 - 'java.util.HashMap' 432 ElseCaseInsteadOfExhaustiveWhen: 433 active: false 434 ignoredSubjectTypes: [] 435 EqualsAlwaysReturnsTrueOrFalse: 436 active: true 437 EqualsWithHashCodeExist: 438 active: true 439 ExitOutsideMain: 440 active: false 441 ExplicitGarbageCollectionCall: 442 active: true 443 HasPlatformType: 444 active: false # (Default: true) 445 IgnoredReturnValue: 446 active: false # (Default: true) 447 restrictToConfig: true 448 returnValueAnnotations: 449 - 'CheckResult' 450 - '*.CheckResult' 451 - 'CheckReturnValue' 452 - '*.CheckReturnValue' 453 ignoreReturnValueAnnotations: 454 - 'CanIgnoreReturnValue' 455 - '*.CanIgnoreReturnValue' 456 returnValueTypes: 457 - 'kotlin.sequences.Sequence' 458 - 'kotlinx.coroutines.flow.*Flow' 459 - 'java.util.stream.*Stream' 460 ignoreFunctionCall: [] 461 ImplicitDefaultLocale: 462 active: false # (Default: true) 463 ImplicitUnitReturnType: 464 active: false 465 allowExplicitReturnType: true 466 InvalidRange: 467 active: true 468 IteratorHasNextCallsNextMethod: 469 active: true 470 IteratorNotThrowingNoSuchElementException: 471 active: true 472 LateinitUsage: 473 active: false 474 excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**'] 475 ignoreOnClassesPattern: '' 476 MapGetWithNotNullAssertionOperator: 477 active: false # (Default: true) 478 MissingPackageDeclaration: 479 active: false 480 excludes: ['**/*.kts'] 481 NullCheckOnMutableProperty: 482 active: false 483 NullableToStringCall: 484 active: false 485 PropertyUsedBeforeDeclaration: 486 active: false 487 UnconditionalJumpStatementInLoop: 488 active: false 489 UnnecessaryNotNullCheck: 490 active: false 491 UnnecessaryNotNullOperator: 492 active: true 493 UnnecessarySafeCall: 494 active: true 495 UnreachableCatchBlock: 496 active: false # (Default: true) 497 UnreachableCode: 498 active: true 499 UnsafeCallOnNullableType: 500 active: true 501 excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**'] 502 UnsafeCast: 503 active: true 504 UnusedUnaryOperator: 505 active: false # (Default: true) 506 UselessPostfixExpression: 507 active: false # (Default: true) 508 WrongEqualsTypeParameter: 509 active: true 510 511 style: 512 active: true 513 AlsoCouldBeApply: 514 active: false 515 BracesOnIfStatements: 516 active: true # Enabled in https://github.com/mozilla-mobile/android-components/issues/1015 517 singleLine: 'consistent' # (Default: never) 518 multiLine: 'always' 519 BracesOnWhenStatements: 520 active: false 521 singleLine: 'necessary' 522 multiLine: 'consistent' 523 CanBeNonNullable: 524 active: false 525 CascadingCallWrapping: 526 active: false 527 includeElvis: true 528 ClassOrdering: 529 active: false 530 CollapsibleIfStatements: 531 active: true # Enabled in https://github.com/mozilla-mobile/android-components/pull/78 532 DataClassContainsFunctions: 533 active: false 534 conversionFunctionPrefix: 535 - 'to' 536 allowOperators: false 537 DataClassShouldBeImmutable: 538 active: false 539 DestructuringDeclarationWithTooManyEntries: 540 active: false # (Default: true) 541 maxDestructuringEntries: 3 542 DoubleNegativeLambda: 543 active: false 544 negativeFunctions: 545 - reason: 'Use `takeIf` instead.' 546 value: 'takeUnless' 547 - reason: 'Use `all` instead.' 548 value: 'none' 549 negativeFunctionNameParts: 550 - 'not' 551 - 'non' 552 EqualsNullCall: 553 active: true 554 EqualsOnSignatureLine: 555 active: false 556 ExplicitCollectionElementAccessMethod: 557 active: false 558 ExplicitItLambdaParameter: 559 active: false # (Default: true) 560 ExpressionBodySyntax: 561 active: false 562 includeLineWrapping: false 563 ForbiddenAnnotation: 564 active: false 565 annotations: 566 - reason: 'it is a java annotation. Use `Suppress` instead.' 567 value: 'java.lang.SuppressWarnings' 568 - reason: 'it is a java annotation. Use `kotlin.Deprecated` instead.' 569 value: 'java.lang.Deprecated' 570 - reason: 'it is a java annotation. Use `kotlin.annotation.MustBeDocumented` instead.' 571 value: 'java.lang.annotation.Documented' 572 - reason: 'it is a java annotation. Use `kotlin.annotation.Target` instead.' 573 value: 'java.lang.annotation.Target' 574 - reason: 'it is a java annotation. Use `kotlin.annotation.Retention` instead.' 575 value: 'java.lang.annotation.Retention' 576 - reason: 'it is a java annotation. Use `kotlin.annotation.Repeatable` instead.' 577 value: 'java.lang.annotation.Repeatable' 578 - reason: 'Kotlin does not support @Inherited annotation, see https://youtrack.jetbrains.com/issue/KT-22265' 579 value: 'java.lang.annotation.Inherited' 580 ForbiddenComment: 581 active: true 582 comments: 583 - reason: 'Forbidden FIXME todo marker in comment, please fix the problem.' 584 value: 'FIXME:' 585 - reason: 'Forbidden STOPSHIP todo marker in comment, please address the problem before shipping the code.' 586 value: 'STOPSHIP:' 587 - reason: 'Forbidden TODO todo marker in comment, please do the changes.' 588 value: 'TODO:' 589 allowedPatterns: '' 590 ForbiddenImport: 591 active: false 592 imports: [] 593 forbiddenPatterns: '' 594 ForbiddenMethodCall: 595 active: false 596 methods: 597 - reason: 'print does not allow you to configure the output stream. Use a logger instead.' 598 value: 'kotlin.io.print' 599 - reason: 'println does not allow you to configure the output stream. Use a logger instead.' 600 value: 'kotlin.io.println' 601 ForbiddenSuppress: 602 active: true 603 rules: ['LongMethod', 'CognitiveComplexMethod', 'CyclomaticComplexMethod', 'MagicNumber'] 604 ForbiddenVoid: 605 active: false # (Default: true) 606 ignoreOverridden: false 607 ignoreUsageInGenerics: false 608 FunctionOnlyReturningConstant: 609 active: true 610 ignoreOverridableFunction: true 611 ignoreActualFunction: true 612 excludedFunctions: [] 613 LoopWithTooManyJumpStatements: 614 active: false # (Default: true) 615 maxJumpCount: 1 616 MagicNumber: 617 active: true 618 excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**', '**/*.kts'] 619 ignoreNumbers: 620 - '-1' 621 - '0' 622 - '1' 623 - '2' 624 - '60' # seconds in minute / minutes in hour 625 - '1000' # millis in second 626 ignoreHashCodeFunction: true 627 ignorePropertyDeclaration: true # Enabled for Compose in https://github.com/mozilla-mobile/android-components/issues/11864 628 ignoreLocalVariableDeclaration: true # (Default: false) Enabled in https://bugzilla.mozilla.org/show_bug.cgi?id=1987018 629 ignoreConstantDeclaration: true 630 ignoreCompanionObjectPropertyDeclaration: true 631 ignoreAnnotation: false 632 ignoreNamedArgument: true 633 ignoreEnums: true # (Default: false) Enabled in https://bugzilla.mozilla.org/show_bug.cgi?id=1987018 634 ignoreRanges: false 635 ignoreExtensionFunctions: true 636 MandatoryBracesLoops: 637 active: false 638 MaxChainedCallsOnSameLine: 639 active: false 640 maxChainedCalls: 5 641 MaxLineLength: 642 active: true 643 maxLineLength: 120 644 excludePackageStatements: true 645 excludeImportStatements: true 646 excludeCommentStatements: false 647 excludeRawStrings: true 648 MayBeConst: 649 active: true 650 ModifierOrder: 651 active: true 652 MultilineLambdaItParameter: 653 active: false 654 MultilineRawStringIndentation: 655 active: false 656 indentSize: 4 657 trimmingMethods: 658 - 'trimIndent' 659 - 'trimMargin' 660 NestedClassesVisibility: 661 active: true 662 NewLineAtEndOfFile: 663 active: true 664 NoTabs: 665 active: true # Enabled in https://github.com/mozilla-mobile/android-components/pull/78 666 NullableBooleanCheck: 667 active: false 668 ObjectLiteralToLambda: 669 active: false # (Default: true) 670 OptionalAbstractKeyword: 671 active: true 672 OptionalUnit: 673 active: false 674 PreferToOverPairSyntax: 675 active: false 676 ProtectedMemberInFinalClass: 677 active: true 678 RedundantExplicitType: 679 active: false 680 RedundantHigherOrderMapUsage: 681 active: false # (Default: true) 682 RedundantVisibilityModifierRule: 683 active: false 684 ReturnCount: 685 active: true 686 max: 3 # (Default: 2) Increased in https://github.com/mozilla-mobile/android-components/issues/3 687 excludedFunctions: 688 - 'equals' 689 excludeLabeled: false 690 excludeReturnFromLambda: true 691 excludeGuardClauses: false 692 SafeCast: 693 active: true 694 SerialVersionUIDInSerializableClass: 695 active: true 696 SpacingBetweenPackageAndImports: 697 active: true # Enabled in https://github.com/mozilla-mobile/android-components/pull/78 698 StringShouldBeRawString: 699 active: false 700 maxEscapedCharacterCount: 2 701 ignoredCharacters: [] 702 ThrowsCount: 703 active: true 704 max: 2 705 excludeGuardClauses: false 706 TrailingWhitespace: 707 active: false 708 TrimMultilineRawString: 709 active: false 710 trimmingMethods: 711 - 'trimIndent' 712 - 'trimMargin' 713 UnderscoresInNumericLiterals: 714 active: false 715 acceptableLength: 4 716 allowNonStandardGrouping: false 717 UnnecessaryAbstractClass: 718 active: true 719 UnnecessaryAnnotationUseSiteTarget: 720 active: false 721 UnnecessaryApply: 722 active: true 723 UnnecessaryBackticks: 724 active: false 725 UnnecessaryBracesAroundTrailingLambda: 726 active: false 727 UnnecessaryFilter: 728 active: false # (Default: true) 729 UnnecessaryInheritance: 730 active: true 731 UnnecessaryInnerClass: 732 active: false 733 UnnecessaryLet: 734 active: false 735 UnnecessaryParentheses: 736 active: false 737 allowForUnclearPrecedence: false 738 UntilInsteadOfRangeTo: 739 active: false 740 UnusedImports: # (Default: false) Enabled in https://bugzilla.mozilla.org/show_bug.cgi?id=1977548 741 active: true 742 UnusedParameter: 743 active: true 744 allowedNames: 'ignored|expected' 745 UnusedPrivateClass: 746 active: true 747 UnusedPrivateMember: 748 active: true 749 allowedNames: '' 750 ignoreAnnotated: ['Composable'] # Configuration for Compose https://github.com/mozilla-mobile/android-components/issues/11866 751 UnusedPrivateProperty: 752 active: true 753 allowedNames: '_|ignored|expected|serialVersionUID' 754 UseAnyOrNoneInsteadOfFind: 755 active: false # (Default: true) 756 UseArrayLiteralsInAnnotations: 757 active: false # (Default: true) 758 UseCheckNotNull: 759 active: true 760 UseCheckOrError: 761 active: false # (Default: true) 762 UseDataClass: 763 active: false 764 allowVars: false 765 UseEmptyCounterpart: 766 active: false 767 UseIfEmptyOrIfBlank: 768 active: false 769 UseIfInsteadOfWhen: 770 active: false 771 ignoreWhenContainingVariableDeclaration: false 772 UseIsNullOrEmpty: 773 active: false # (Default: true) 774 UseLet: 775 active: false 776 UseOrEmpty: 777 active: true 778 UseRequire: 779 active: true 780 UseRequireNotNull: 781 active: true 782 UseSumOfInsteadOfFlatMapSize: 783 active: false 784 UselessCallOnNotNull: 785 active: true 786 UtilityClassWithPublicConstructor: 787 active: true 788 VarCouldBeVal: 789 active: true 790 ignoreLateinitVar: false 791 WildcardImport: 792 active: true