Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
cov/c3 ▾

Modern-Apps.git / detekt.yml

detekt.yml916 lines · 27.8 KiBRaw
1# Lint rollout policy: warn-then-error.
2# New or tightened rules land as `warning` (detekt / Android Lint) / `warn`
3# (Rust) first, are cleaned per module, then promote to error/fatal/deny.
4# Never flip warningsAsErrors / abortOnError globally before the owning
5# slice is green. Base marker ban (FIXME:/STOPSHIP:/TODO:) stays blocking;
6# new marker shapes (HACK:/XXX:, evasions) land warning-first.
7config:
8 validation: true
9 warningsAsErrors: false
10 checkExhaustiveness: false
11 # when writing own rules with new properties, exclude the property path e.g.: ['my_rule_set', '.*>.*>[my_property]']
12 excludes: []
13
14processors:
15 active: true
16 exclude:
17 # - 'KtFileCountProcessor'
18 # - 'PackageCountProcessor'
19 # - 'ClassCountProcessor'
20 # - 'FunctionCountProcessor'
21 # - 'PropertyCountProcessor'
22 # - 'ProjectCyclomaticComplexityProcessor'
23 # - 'ProjectCognitiveComplexityProcessor'
24 # - 'ProjectLLOCProcessor'
25 # - 'ProjectCLOCProcessor'
26 # - 'ProjectLOCProcessor'
27 # - 'ProjectSLOCProcessor'
28
29console-reports:
30 active: true
31 exclude:
32 - 'ProjectStatisticsReport'
33 - 'ComplexityReport'
34 - 'NotificationReport'
35 - 'IssuesReport'
36 - 'FileBasedIssuesReport'
37 # - 'LiteIssuesReport'
38
39comments:
40 active: true
41 AbsentOrWrongFileLicense:
42 active: false
43 licenseTemplateIsRegex: false
44 licenseTemplate: ''
45 DeprecatedBlockTag:
46 active: false
47 DocumentationOverPrivateFunction:
48 active: false
49 DocumentationOverPrivateProperty:
50 active: false
51 EndOfSentenceFormat:
52 active: false
53 endOfSentenceFormat: '([.?!][ \t\n\r\f<])|([.?!:]$)'
54 KDocReferencesNonPublicProperty:
55 active: false
56 excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
57 OutdatedDocumentation:
58 active: false
59 matchTypeParameters: true
60 matchDeclarationsOrder: true
61 allowParamOnConstructorProperties: false
62 exhaustive: true
63 # Lint-sweep trial (warn-then-error): public classes and functions
64 # need KDoc at warning severity. Public-API-only posture: private/internal
65 # stay exempt (detekt only reports public API for these rules), tests stay
66 # excluded below. Promotes to error once the owning slices are green;
67 # UndocumentedPublicProperty stays off until then.
68 UndocumentedPublicClass:
69 active: true
70 severity: warning
71 excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
72 searchInNestedClass: true
73 searchInInnerClass: true
74 searchInInnerObject: true
75 searchInInnerInterface: true
76 searchInProtectedClass: false
77 ignoreDefaultCompanionObject: false
78 UndocumentedPublicFunction:
79 active: false
80 excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
81 searchProtectedFunction: false
82 UndocumentedPublicProperty:
83 active: false
84 excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
85 searchProtectedProperty: false
86 ignoreEnumEntries: false
87
88complexity:
89 active: true
90 CognitiveComplexMethod:
91 active: false
92 allowedComplexity: 15
93 ComplexCondition:
94 active: true
95 allowedConditions: 3
96 # Declarative UI branches read as lists, not nesting — measured elsewhere.
97 excludes: ['**/ui/**']
98 ComplexInterface:
99 active: false
100 allowedDefinitions: 10
101 includeStaticDeclarations: false
102 includePrivateDeclarations: false
103 ignoreOverloaded: false
104 CyclomaticComplexMethod:
105 active: true
106 allowedComplexity: 14
107 # Stateless screens branch over UI state; length/complexity caps that fit
108 # ViewModels and repositories do not fit declarative UI. Excluded here,
109 # still covered by FileLength (fatal lint) at the file level.
110 excludes: ['**/ui/**']
111 ignoreSingleWhenExpression: false
112 ignoreSimpleWhenEntries: false
113 ignoreNestingFunctions: false
114 ignoreLocalFunctions: false
115 nestingFunctions:
116 - 'also'
117 - 'apply'
118 - 'forEach'
119 - 'isNotNull'
120 - 'ifNull'
121 - 'let'
122 - 'run'
123 - 'use'
124 - 'with'
125 LabeledExpression:
126 active: false
127 ignoredLabels: []
128 LargeClass:
129 active: true
130 allowedLines: 600
131 # Hand-written document-format converters (OOXML/ODF/RTF in library/ui odf/)
132 # mirror spec structure function-for-function; splitting them would scatter
133 # single-format logic. FileLength (fatal lint) still caps file size.
134 excludes: ['**/odf/**']
135 LongMethod:
136 active: true
137 allowedLines: 60
138 # Same rationale as CyclomaticComplexMethod above.
139 excludes: ['**/ui/**']
140 LongParameterList:
141 active: true
142 allowedFunctionParameters: 5
143 allowedConstructorParameters: 6
144 ignoreDefaultParameters: false
145 ignoreDataClasses: true
146 ignoreAnnotatedParameter: []
147 MethodOverloading:
148 active: false
149 allowedOverloads: 6
150 NamedArguments:
151 active: false
152 allowedArguments: 3
153 ignoreMethods: []
154 ignoreArgumentsMatchingNames: false
155 NestedBlockDepth:
156 active: true
157 allowedDepth: 4
158 # Same rationale as LargeClass above: nested dispatch mirrors the formats.
159 excludes: ['**/odf/**']
160 NestedScopeFunctions:
161 active: false
162 allowedDepth: 1
163 functions:
164 - 'kotlin.apply'
165 - 'kotlin.run'
166 - 'kotlin.with'
167 - 'kotlin.let'
168 - 'kotlin.also'
169 ReplaceSafeCallChainWithRun:
170 active: false
171 StringLiteralDuplication:
172 active: false
173 excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
174 allowedDuplications: 2
175 ignoreAnnotation: true
176 allowedWithLengthLessThan: 5
177 ignoreStringsRegex: '$^'
178 TooManyFunctions:
179 active: true
180 excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**', '**/Icons.kt', '**/MaterialComponents.kt', '**/service/**', '**/odf/**']
181 # UiContract interfaces declare one callback per user action and ViewModels
182 # implement them; 12 is normal here (see notes NotesUiContract/NotesViewModel).
183 # File scope: registry files (Icons.kt holds EVERY IconXxx by repo rule;
184 # MaterialComponents.kt is the m3 re-export surface) can never satisfy a cap,
185 # and FileLength (fatal lint) already gates file size. Service scope: system
186 # service classes mirror platform interfaces method-for-method.
187 allowedFunctionsPerFile: 30
188 allowedFunctionsPerClass: 25
189 allowedFunctionsPerInterface: 25
190 allowedFunctionsPerObject: 25
191 allowedFunctionsPerEnum: 25
192 ignoreDeprecated: false
193 ignorePrivate: false
194 ignoreInternal: false
195 ignoreOverridden: false
196 ignoreAnnotatedFunctions: []
197
198coroutines:
199 active: true
200 CoroutineLaunchedInTestWithoutRunTest:
201 active: false
202 GlobalCoroutineUsage:
203 active: false
204 InjectDispatcher:
205 active: true
206 dispatcherNames:
207 - 'IO'
208 - 'Default'
209 - 'Unconfined'
210 RedundantSuspendModifier:
211 active: true
212 SleepInsteadOfDelay:
213 active: true
214 SuspendFunInFinallySection:
215 active: false
216 SuspendFunSwallowedCancellation:
217 active: false
218 SuspendFunWithCoroutineScopeReceiver:
219 active: false
220 aliases: ['SuspendFunctionOnCoroutineScope']
221 SuspendFunWithFlowReturnType:
222 active: true
223
224empty-blocks:
225 active: true
226 EmptyCatchBlock:
227 active: true
228 allowedExceptionNameRegex: '_|(ignore|expected).*'
229 EmptyClassBlock:
230 active: true
231 EmptyDefaultConstructor:
232 active: true
233 EmptyDoWhileBlock:
234 active: true
235 EmptyElseBlock:
236 active: true
237 # In format converters an empty else documents "this variant intentionally
238 # produces no output" at the exact dispatch site; deleting them loses that.
239 excludes: ['**/odf/**']
240 EmptyFinallyBlock:
241 active: true
242 EmptyForBlock:
243 active: true
244 EmptyFunctionBlock:
245 active: true
246 # Interface-mandated no-ops (e.g. unused TextWatcher callbacks) stay visible
247 # as empty overrides rather than being deleted.
248 ignoreOverridden: true
249 EmptyIfBlock:
250 active: true
251 EmptyInitBlock:
252 active: true
253 EmptyKotlinFile:
254 active: true
255 EmptySecondaryConstructor:
256 active: true
257 EmptyTryBlock:
258 active: true
259 EmptyWhenBlock:
260 active: true
261 EmptyWhileBlock:
262 active: true
263
264exceptions:
265 active: true
266 ErrorUsageWithThrowable:
267 active: false
268 ExceptionRaisedInUnexpectedLocation:
269 active: true
270 methodNames:
271 - 'equals'
272 - 'finalize'
273 - 'hashCode'
274 - 'toString'
275 InstanceOfCheckForException:
276 active: true
277 excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
278 NotImplementedDeclaration:
279 active: false
280 ObjectExtendsThrowable:
281 active: false
282 PrintStackTrace:
283 active: true
284 RethrowCaughtException:
285 active: true
286 ReturnFromFinally:
287 active: true
288 ignoreLabeled: false
289 SwallowedException:
290 active: true
291 ignoredExceptionTypes:
292 - 'InterruptedException'
293 - 'MalformedURLException'
294 - 'NumberFormatException'
295 - 'ParseException'
296 allowedExceptionNameRegex: '_|(ignore|expected).*'
297 ThrowingExceptionFromFinally:
298 active: true
299 ThrowingExceptionInMain:
300 active: false
301 ThrowingExceptionsWithoutMessageOrCause:
302 active: true
303 excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
304 exceptions:
305 - 'ArrayIndexOutOfBoundsException'
306 - 'Exception'
307 - 'IllegalArgumentException'
308 - 'IllegalMonitorStateException'
309 - 'IllegalStateException'
310 - 'IndexOutOfBoundsException'
311 - 'NullPointerException'
312 - 'RuntimeException'
313 - 'Throwable'
314 ThrowingNewInstanceOfSameException:
315 active: true
316 TooGenericExceptionCaught:
317 active: true
318 excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
319 exceptionNames:
320 - 'ArrayIndexOutOfBoundsException'
321 - 'Error'
322 - 'Exception'
323 - 'IllegalMonitorStateException'
324 - 'IndexOutOfBoundsException'
325 - 'NullPointerException'
326 - 'RuntimeException'
327 - 'Throwable'
328 allowedExceptionNameRegex: '_|(ignore|expected).*'
329 TooGenericExceptionThrown:
330 active: true
331 exceptionNames:
332 - 'Error'
333 - 'Exception'
334 - 'RuntimeException'
335 - 'Throwable'
336
337naming:
338 active: true
339 BooleanPropertyNaming:
340 active: false
341 allowedPattern: '^(is|has|are)'
342 ClassNaming:
343 active: true
344 aliases: ['ClassName']
345 classPattern: '[A-Z][a-zA-Z0-9]*'
346 ConstructorParameterNaming:
347 active: true
348 parameterPattern: '[a-z][A-Za-z0-9]*'
349 privateParameterPattern: '[a-z][A-Za-z0-9]*'
350 excludeClassPattern: '$^'
351 EnumNaming:
352 active: true
353 aliases: ['EnumEntryName']
354 enumEntryPattern: '[A-Z][_a-zA-Z0-9]*'
355 ForbiddenClassName:
356 active: false
357 forbiddenName: []
358 FunctionNameMaxLength:
359 active: false
360 aliases: ['FunctionMaxNameLength']
361 maximumFunctionNameLength: 30
362 FunctionNameMinLength:
363 active: false
364 aliases: ['FunctionMinNameLength']
365 minimumFunctionNameLength: 3
366 FunctionNaming:
367 active: true
368 aliases: ['FunctionName']
369 excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
370 functionPattern: '[a-z][a-zA-Z0-9]*'
371 excludeClassPattern: '$^'
372 # @Composable functions are PascalCase by Compose convention (one public
373 # composable per file, named as the file — see AGENTS.md).
374 ignoreAnnotated: ['Composable']
375 FunctionParameterNaming:
376 active: true
377 parameterPattern: '[a-z][A-Za-z0-9]*'
378 excludeClassPattern: '$^'
379 InvalidPackageDeclaration:
380 active: true
381 aliases: ['PackageDirectoryMismatch']
382 rootPackage: ''
383 requireRootInDeclaration: false
384 LambdaParameterNaming:
385 active: false
386 parameterPattern: '[a-z][A-Za-z0-9]*|_'
387 # Files are named for their primary @Composable with private helpers alongside
388 # (one public composable per file — see AGENTS.md); that pattern inherently
389 # mismatches "single top-level declaration". OneComposablePerFile (fatal lint)
390 # covers the real concern.
391 MatchingDeclarationName:
392 active: false
393 MemberNameEqualsClassName:
394 active: true
395 ignoreOverridden: true
396 NoNameShadowing:
397 active: true
398 NonBooleanPropertyPrefixedWithIs:
399 active: false
400 allowSingleTypedGenerics: false
401 ObjectPropertyNaming:
402 active: true
403 aliases: ['ObjectPropertyName']
404 constantPattern: '[A-Za-z][_A-Za-z0-9]*'
405 propertyPattern: '[A-Za-z][_A-Za-z0-9]*'
406 privatePropertyPattern: '(_)?[A-Za-z][_A-Za-z0-9]*'
407 PackageNaming:
408 active: true
409 aliases: ['PackageName']
410 packagePattern: '[a-z]+(\.[a-z][A-Za-z0-9]*)*'
411 TopLevelPropertyNaming:
412 active: true
413 constantPattern: '[A-Z][_A-Z0-9]*'
414 propertyPattern: '[A-Za-z][_A-Za-z0-9]*'
415 privatePropertyPattern: '_?[A-Za-z][_A-Za-z0-9]*'
416 VariableMaxLength:
417 active: false
418 maximumVariableNameLength: 64
419 VariableMinLength:
420 active: false
421 minimumVariableNameLength: 1
422 VariableNaming:
423 active: true
424 aliases: ['PropertyName']
425 variablePattern: '[a-z][A-Za-z0-9]*'
426 privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*'
427 excludeClassPattern: '$^'
428
429performance:
430 active: true
431 ArrayPrimitive:
432 active: true
433 CouldBeSequence:
434 active: false
435 allowedOperations: 2
436 ForEachOnRange:
437 active: true
438 excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
439 SpreadOperator:
440 active: true
441 excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
442 UnnecessaryInitOnArray:
443 active: false
444 UnnecessaryPartOfBinaryExpression:
445 active: false
446 UnnecessaryTemporaryInstantiation:
447 active: true
448 UnnecessaryTypeCasting:
449 active: false
450
451potential-bugs:
452 active: true
453 AvoidReferentialEquality:
454 active: true
455 forbiddenTypePatterns:
456 - 'kotlin.String'
457 CastNullableToNonNullableType:
458 active: false
459 ignorePlatformTypes: true
460 CastToNullableType:
461 active: false
462 CharArrayToStringCall:
463 active: false
464 Deprecation:
465 active: false
466 aliases: ['DEPRECATION']
467 DontDowncastCollectionTypes:
468 active: false
469 DoubleMutabilityForCollection:
470 active: true
471 aliases: ['DoubleMutability']
472 mutableTypes:
473 - 'kotlin.collections.MutableList'
474 - 'kotlin.collections.MutableMap'
475 - 'kotlin.collections.MutableSet'
476 - 'java.util.ArrayList'
477 - 'java.util.LinkedHashSet'
478 - 'java.util.HashSet'
479 - 'java.util.LinkedHashMap'
480 - 'java.util.HashMap'
481 ElseCaseInsteadOfExhaustiveWhen:
482 active: false
483 ignoredSubjectTypes: []
484 EqualsAlwaysReturnsTrueOrFalse:
485 active: true
486 EqualsWithHashCodeExist:
487 active: true
488 ExitOutsideMain:
489 active: false
490 ExplicitGarbageCollectionCall:
491 active: true
492 HasPlatformType:
493 active: true
494 IgnoredReturnValue:
495 active: true
496 restrictToConfig: true
497 returnValueAnnotations:
498 - 'CheckResult'
499 - '*.CheckResult'
500 - 'CheckReturnValue'
501 - '*.CheckReturnValue'
502 ignoreReturnValueAnnotations:
503 - 'CanIgnoreReturnValue'
504 - '*.CanIgnoreReturnValue'
505 returnValueTypes:
506 - 'kotlin.Function*'
507 - 'kotlin.sequences.Sequence'
508 - 'kotlinx.coroutines.flow.*Flow'
509 - 'java.util.stream.*Stream'
510 ignoreFunctionCall: []
511 ImplicitDefaultLocale:
512 active: true
513 ImplicitUnitReturnType:
514 active: false
515 ignoreAnnotated: ['Test']
516 allowExplicitReturnType: true
517 InvalidRange:
518 active: true
519 IteratorHasNextCallsNextMethod:
520 active: true
521 IteratorNotThrowingNoSuchElementException:
522 active: true
523 LateinitUsage:
524 active: false
525 excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
526 ignoreOnClassesPattern: ''
527 MapGetWithNotNullAssertionOperator:
528 active: true
529 MissingPackageDeclaration:
530 active: false
531 excludes: ['**/*.kts']
532 MissingSuperCall:
533 active: false
534 mustInvokeSuperAnnotations:
535 - 'androidx.annotation.CallSuper'
536 - 'javax.annotation.OverridingMethodsMustInvokeSuper'
537 MissingUseCall:
538 active: false
539 ignoreClass:
540 - 'java.io.ByteArrayInputStream'
541 - 'java.io.ByteArrayOutputStream'
542 NullCheckOnMutableProperty:
543 active: false
544 NullableToStringCall:
545 active: false
546 PropertyUsedBeforeDeclaration:
547 active: false
548 UnconditionalJumpStatementInLoop:
549 active: false
550 UnnamedParameterUse:
551 active: false
552 allowAdjacentDifferentTypeParams: true
553 allowSingleParamUse: true
554 ignoreArgumentsMatchingNames: true
555 ignoreFunctionCall: []
556 UnnecessaryNotNullCheck:
557 active: false
558 UnnecessaryNotNullOperator:
559 active: true
560 UnnecessarySafeCall:
561 active: true
562 UnreachableCatchBlock:
563 active: true
564 UnreachableCode:
565 active: true
566 UnsafeCallOnNullableType:
567 active: true
568 excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
569 UnsafeCast:
570 active: true
571 aliases: ['UNCHECKED_CAST']
572 UnusedUnaryOperator:
573 active: true
574 UselessPostfixExpression:
575 active: true
576 WrongEqualsTypeParameter:
577 active: true
578
579style:
580 active: true
581 AbstractClassCanBeConcreteClass:
582 active: true
583 AbstractClassCanBeInterface:
584 active: true
585 ignoreSealedClasses: false
586 AlsoCouldBeApply:
587 active: false
588 BracesOnIfStatements:
589 active: false
590 singleLine: 'never'
591 multiLine: 'always'
592 BracesOnWhenStatements:
593 active: false
594 singleLine: 'necessary'
595 multiLine: 'consistent'
596 CanBeNonNullable:
597 active: false
598 CascadingCallWrapping:
599 active: false
600 includeElvis: true
601 ClassOrdering:
602 active: false
603 CollapsibleIfStatements:
604 active: false
605 DataClassContainsFunctions:
606 active: false
607 conversionFunctionPrefix:
608 - 'to'
609 allowOperators: false
610 DataClassShouldBeImmutable:
611 active: false
612 DestructuringDeclarationWithTooManyEntries:
613 active: true
614 # Data quadruples (freq/duration/gain/decay, RGBA) are the natural shape.
615 maxDestructuringEntries: 4
616 DoubleNegativeExpression:
617 active: false
618 DoubleNegativeLambda:
619 active: false
620 negativeFunctions:
621 - reason: 'Use `takeIf` instead.'
622 value: 'takeUnless'
623 - reason: 'Use `all` instead.'
624 value: 'none'
625 negativeFunctionNameParts:
626 - 'not'
627 - 'non'
628 EqualsNullCall:
629 active: true
630 EqualsOnSignatureLine:
631 active: false
632 ExplicitCollectionElementAccessMethod:
633 active: false
634 ExplicitItLambdaMultipleParameters:
635 active: true
636 ExplicitItLambdaParameter:
637 active: true
638 ExpressionBodySyntax:
639 active: false
640 includeLineWrapping: false
641 ForbiddenAnnotation:
642 active: false
643 annotations:
644 - reason: 'it is a java annotation. Use `Suppress` instead.'
645 value: 'java.lang.SuppressWarnings'
646 - reason: 'it is a java annotation. Use `kotlin.Deprecated` instead.'
647 value: 'java.lang.Deprecated'
648 - reason: 'it is a java annotation. Use `kotlin.annotation.MustBeDocumented` instead.'
649 value: 'java.lang.annotation.Documented'
650 - reason: 'it is a java annotation. Use `kotlin.annotation.Target` instead.'
651 value: 'java.lang.annotation.Target'
652 - reason: 'it is a java annotation. Use `kotlin.annotation.Retention` instead.'
653 value: 'java.lang.annotation.Retention'
654 - reason: 'it is a java annotation. Use `kotlin.annotation.Repeatable` instead.'
655 value: 'java.lang.annotation.Repeatable'
656 ForbiddenComment:
657 active: true
658 comments:
659 - reason: 'Forbidden FIXME todo marker in comment, please fix the problem.'
660 value: 'FIXME:'
661 - reason: 'Forbidden STOPSHIP todo marker in comment, please address the problem before shipping the code.'
662 value: 'STOPSHIP:'
663 - reason: 'Forbidden TODO todo marker in comment, please do the changes.'
664 value: 'TODO:'
665 # Warn-then-error extension: HACK:/XXX: land as detekt findings
666 # alongside the TodoEvasion lint check, then join the hard ban at promotion.
667 # Evasion shapes (TODO(scope):, bare banners) are covered by the
668 # TodoEvasionDetector lint rule, which sees comment PSI that detekt's
669 # exact-substring match cannot express.
670 - reason: 'Forbidden HACK marker in comment, please fix the problem instead of working around it.'
671 value: 'HACK:'
672 - reason: 'Forbidden XXX marker in comment, please fix the problem instead of marking it.'
673 value: 'XXX:'
674 allowedPatterns: ''
675 ForbiddenImport:
676 active: false
677 forbiddenImports: []
678 allowedImports: []
679 ForbiddenMethodCall:
680 active: false
681 methods:
682 - reason: 'print does not allow you to configure the output stream. Use a logger instead.'
683 value: 'kotlin.io.print'
684 - reason: 'println does not allow you to configure the output stream. Use a logger instead.'
685 value: 'kotlin.io.println'
686 - reason: 'using `BigDecimal(Double)` can result in unexpected floating point precision behavior. Use `BigDecimal.valueOf(Double)` or `String.toBigDecimalOrNull()` instead.'
687 value: 'java.math.BigDecimal.<init>(kotlin.Double)'
688 - reason: 'using `BigDecimal(String)` can result in a `NumberFormatException`. Use `String.toBigDecimalOrNull()`'
689 value: 'java.math.BigDecimal.<init>(kotlin.String)'
690 - reason: 'It is marked as obsolete. Use `kotlin.time.measureTime` instead.'
691 value: 'kotlin.system.measureTimeMillis'
692 ForbiddenNamedParam:
693 active: false
694 methods: []
695 ForbiddenOptIn:
696 active: false
697 markerClasses: []
698 ForbiddenSuppress:
699 active: false
700 rules: []
701 ForbiddenVoid:
702 active: true
703 ignoreOverridden: false
704 ignoreUsageInGenerics: false
705 FunctionOnlyReturningConstant:
706 active: true
707 ignoreOverridableFunction: true
708 ignoreActualFunction: true
709 excludedFunctions: []
710 LoopWithTooManyJumpStatements:
711 active: true
712 maxJumpCount: 1
713 # Segment loops over spec-defined formats live in domain/ (see MagicNumber);
714 # gesture/drag state machines live in ui/.
715 excludes: ['**/domain/**', '**/ui/**']
716 MagicNumber:
717 active: true
718 excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**', '**/*.kts', '**/ui/**', '**/domain/**']
719 # dp/sp/size literals are idiomatic Compose; domain/ is pure crypto/math
720 # (BIP-39 bit groups, AES params) where the numbers ARE the spec.
721 ignoreNumbers:
722 - '-1'
723 - '0'
724 - '1'
725 - '2'
726 ignoreHashCodeFunction: true
727 ignorePropertyDeclaration: true
728 ignoreLocalVariableDeclaration: true
729 ignoreConstantDeclaration: true
730 ignoreCompanionObjectPropertyDeclaration: true
731 ignoreAnnotation: false
732 ignoreNamedArgument: true
733 ignoreEnums: false
734 ignoreRanges: false
735 ignoreExtensionFunctions: true
736 MandatoryBracesLoops:
737 active: false
738 MaxChainedCallsOnSameLine:
739 active: false
740 maxChainedCalls: 5
741 MaxLineLength:
742 active: true
743 maxLineLength: 120
744 # Long call chains are endemic to Compose DSL; test data (wordlists) is
745 # unbreakable. Non-UI, non-test code stays at 120.
746 excludes: ['**/ui/**', '**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**']
747 excludePackageStatements: true
748 excludeImportStatements: true
749 excludeCommentStatements: false
750 excludeRawStrings: true
751 MayBeConstant:
752 active: true
753 ModifierOrder:
754 active: true
755 MultilineLambdaItParameter:
756 active: false
757 MultilineRawStringIndentation:
758 active: false
759 indentSize: 4
760 trimmingMethods:
761 - 'trimIndent'
762 - 'trimMargin'
763 NestedClassesVisibility:
764 active: true
765 NewLineAtEndOfFile:
766 active: true
767 NoTabs:
768 active: false
769 NullableBooleanCheck:
770 active: false
771 ObjectLiteralToLambda:
772 active: true
773 OptionalAbstractKeyword:
774 active: true
775 OptionalUnit:
776 active: false
777 ProtectedMemberInFinalClass:
778 active: true
779 RangeUntilInsteadOfRangeTo:
780 active: false
781 RedundantConstructorKeyword:
782 active: false
783 RedundantExplicitType:
784 active: false
785 RedundantHigherOrderMapUsage:
786 active: true
787 RedundantVisibilityModifier:
788 active: false
789 ReturnCount:
790 active: true
791 # Guard-clause helpers (3), Worker doWork / path fallbacks (4), framework
792 # overrides such as WebViewClient callbacks and protocol parsers (6).
793 # odf/ converters dispatch per format construct (see LargeClass).
794 excludes: ['**/odf/**']
795 max: 6
796 excludedFunctions:
797 - 'equals'
798 excludeLabeled: false
799 excludeReturnFromLambda: true
800 excludeGuardClauses: false
801 SafeCast:
802 active: true
803 SerialVersionUIDInSerializableClass:
804 active: true
805 SpacingAfterPackageAndImports:
806 active: false
807 StringShouldBeRawString:
808 active: false
809 maxEscapedCharacterCount: 2
810 ignoredCharacters: []
811 ThrowsCount:
812 active: true
813 max: 2
814 excludeGuardClauses: false
815 # Crypto validation throws one per failure mode (bad password, corrupt
816 # segment, wrong version) — that is the correct shape there.
817 excludes: ['**/domain/**']
818 TrailingWhitespace:
819 active: false
820 TrimMultilineRawString:
821 active: false
822 trimmingMethods:
823 - 'trimIndent'
824 - 'trimMargin'
825 UnderscoresInNumericLiterals:
826 active: false
827 acceptableLength: 4
828 allowNonStandardGrouping: false
829 UnnecessaryAny:
830 active: false
831 UnnecessaryApply:
832 active: true
833 UnnecessaryBackticks:
834 active: false
835 UnnecessaryBracesAroundTrailingLambda:
836 active: false
837 UnnecessaryFilter:
838 active: true
839 UnnecessaryFullyQualifiedName:
840 active: false
841 ignoredFullyQualifiedNames: []
842 UnnecessaryInheritance:
843 active: true
844 UnnecessaryInnerClass:
845 active: false
846 UnnecessaryLet:
847 active: false
848 UnnecessaryParentheses:
849 active: false
850 allowForUnclearPrecedence: false
851 UnnecessaryReversed:
852 active: false
853 UnusedImport:
854 active: false
855 additionalOperatorSet: []
856 UnusedParameter:
857 active: true
858 aliases: ['UNUSED_PARAMETER', 'unused']
859 allowedNames: 'ignored|expected'
860 UnusedPrivateClass:
861 active: true
862 aliases: ['unused']
863 UnusedPrivateFunction:
864 active: true
865 aliases: ['unused']
866 allowedNames: ''
867 UnusedPrivateProperty:
868 active: true
869 aliases: ['unused']
870 allowedNames: 'ignored|expected|serialVersionUID'
871 UnusedVariable:
872 active: true
873 aliases: ['UNUSED_VARIABLE', 'unused']
874 allowedNames: 'ignored|_'
875 UseAnyOrNoneInsteadOfFind:
876 active: true
877 UseArrayLiteralsInAnnotations:
878 active: true
879 UseCheckNotNull:
880 active: true
881 UseCheckOrError:
882 active: true
883 UseDataClass:
884 active: false
885 allowVars: false
886 UseEmptyCounterpart:
887 active: false
888 UseIfEmptyOrIfBlank:
889 active: false
890 UseIfInsteadOfWhen:
891 active: false
892 ignoreWhenContainingVariableDeclaration: false
893 UseIsNullOrEmpty:
894 active: true
895 UseLet:
896 active: false
897 UseOrEmpty:
898 active: true
899 UseRequire:
900 active: true
901 UseRequireNotNull:
902 active: true
903 UseSumOfInsteadOfFlatMapSize:
904 active: false
905 UselessCallOnNotNull:
906 active: true
907 UtilityClassWithPublicConstructor:
908 active: true
909 VarCouldBeVal:
910 active: true
911 aliases: ['CanBeVal']
912 ignoreLateinitVar: false
913 WildcardImport:
914 active: true
915 excludeImports:
916 - 'java.util.*'