1- # https://github.com/arturbosch/detekt/blob/1.3 .1/detekt-cli/src/main/resources/default-detekt-config.yml
1+ # https://github.com/arturbosch/detekt/blob/1.7 .1/detekt-cli/src/main/resources/default-detekt-config.yml
22
33comments :
44 active : false
@@ -12,16 +12,15 @@ complexity:
1212 active : true
1313 threshold : 10
1414 includeStaticDeclarations : false
15+ includePrivateDeclarations : false
1516 ComplexMethod :
1617 active : true
1718 threshold : 15
1819 ignoreSingleWhenExpression : false
1920 ignoreSimpleWhenEntries : false
2021 ignoreNestingFunctions : false
21- nestingFunctions : run,let,apply,with,also,use,forEach,isNotNull,ifNull
2222 LabeledExpression :
2323 active : false
24- ignoredLabels : " "
2524 LargeClass :
2625 active : true
2726 threshold : 600
@@ -30,23 +29,26 @@ complexity:
3029 threshold : 60
3130 LongParameterList :
3231 active : true
33- threshold : 6
32+ functionThreshold : 6
33+ constructorThreshold : 7
3434 ignoreDefaultParameters : true
35+ ignoreDataClasses : true
36+ ignoreAnnotated : []
3537 MethodOverloading :
3638 active : false
3739 NestedBlockDepth :
3840 active : true
3941 threshold : 4
4042 StringLiteralDuplication :
4143 active : true
42- excludes : " **/test/**, **/androidTest/**, **/*.Test.kt, **/*.Spec.kt, **/*.Spek.kt"
44+ excludes : [' **/test/**', ' **/androidTest/**', ' **/*.Test.kt', ' **/*.Spec.kt', ' **/*.Spek.kt']
4345 threshold : 3
4446 ignoreAnnotation : true
4547 excludeStringsWithLessThan5Characters : true
4648 ignoreStringsRegex : ' $^'
4749 TooManyFunctions :
4850 active : true
49- excludes : " **/test/**, **/androidTest/**, **/*.Test.kt, **/*.Spec.kt, **/*.Spek.kt"
51+ excludes : [' **/test/**', ' **/androidTest/**', ' **/*.Test.kt', ' **/*.Spec.kt', ' **/*.Spek.kt']
5052 thresholdInFiles : 11
5153 thresholdInClasses : 11
5254 thresholdInInterfaces : 11
@@ -56,11 +58,18 @@ complexity:
5658 ignorePrivate : false
5759 ignoreOverridden : true
5860
61+ coroutines :
62+ active : true
63+ GlobalCoroutineUsage :
64+ active : false
65+ RedundantSuspendModifier :
66+ active : true
67+
5968empty-blocks :
6069 active : true
6170 EmptyCatchBlock :
6271 active : true
63- allowedExceptionNameRegex : " ^(_|(ignore|expected).*)"
72+ allowedExceptionNameRegex : ' ^(_|(ignore|expected).*)'
6473 EmptyClassBlock :
6574 active : true
6675 EmptyDefaultConstructor :
@@ -75,7 +84,7 @@ empty-blocks:
7584 active : true
7685 EmptyFunctionBlock :
7786 active : true
78- ignoreOverriddenFunctions : true
87+ ignoreOverridden : true
7988 EmptyIfBlock :
8089 active : true
8190 EmptyInitBlock :
@@ -84,6 +93,8 @@ empty-blocks:
8493 active : true
8594 EmptySecondaryConstructor :
8695 active : true
96+ EmptyTryBlock :
97+ active : true
8798 EmptyWhenBlock :
8899 active : true
89100 EmptyWhileBlock :
@@ -93,7 +104,7 @@ exceptions:
93104 active : true
94105 ExceptionRaisedInUnexpectedLocation :
95106 active : true
96- methodNames : ' toString,hashCode,equals,finalize'
107+ methodNames : [ toString, hashCode, equals, finalize]
97108 InstanceOfCheckForException :
98109 active : false
99110 NotImplementedDeclaration :
@@ -107,37 +118,44 @@ exceptions:
107118 ignoreLabeled : true
108119 SwallowedException :
109120 active : true
110- ignoredExceptionTypes : ' InterruptedException,NumberFormatException,ParseException,MalformedURLException'
111- allowedExceptionNameRegex : " ^(_|(ignore|expected).*)"
121+ ignoredExceptionTypes :
122+ - InterruptedException
123+ - NumberFormatException
124+ - ParseException
125+ - MalformedURLException
126+ allowedExceptionNameRegex : ' ^(_|(ignore|expected).*)'
112127 ThrowingExceptionFromFinally :
113128 active : false
114129 ThrowingExceptionInMain :
115130 active : true
116131 ThrowingExceptionsWithoutMessageOrCause :
117132 active : true
118- exceptions : ' IllegalArgumentException,IllegalStateException,IOException'
133+ exceptions :
134+ - IllegalArgumentException
135+ - IllegalStateException
136+ - IOException
119137 ThrowingNewInstanceOfSameException :
120138 active : true
121139 TooGenericExceptionCaught :
122140 active : true
123- excludes : " **/test/**, **/androidTest/**, **/*.Test.kt, **/*.Spec.kt, **/*.Spek.kt"
141+ excludes : [' **/test/**', ' **/androidTest/**', ' **/*.Test.kt', ' **/*.Spec.kt', ' **/*.Spek.kt']
124142 exceptionNames :
125- - ArrayIndexOutOfBoundsException
126- - Error
127- - Exception
128- - IllegalMonitorStateException
129- - NullPointerException
130- - IndexOutOfBoundsException
131- - RuntimeException
132- - Throwable
133- allowedExceptionNameRegex : " ^(_|(ignore|expected).*)"
143+ - ArrayIndexOutOfBoundsException
144+ - Error
145+ - Exception
146+ - IllegalMonitorStateException
147+ - NullPointerException
148+ - IndexOutOfBoundsException
149+ - RuntimeException
150+ - Throwable
151+ allowedExceptionNameRegex : ' ^(_|(ignore|expected).*)'
134152 TooGenericExceptionThrown :
135153 active : true
136154 exceptionNames :
137- - Error
138- - Exception
139- - Throwable
140- - RuntimeException
155+ - Error
156+ - Exception
157+ - Throwable
158+ - RuntimeException
141159
142160formatting :
143161 active : true
@@ -151,11 +169,15 @@ formatting:
151169 autoCorrect : true
152170 CommentSpacing :
153171 active : false
172+ EnumEntryNameCase :
173+ active : true
174+ autoCorrect : false
154175 Filename :
155176 active : true
156177 FinalNewline :
157178 active : true
158179 autoCorrect : true
180+ insertFinalNewLine : true
159181 ImportOrdering :
160182 active : false
161183 Indentation :
@@ -180,6 +202,9 @@ formatting:
180202 NoEmptyClassBody :
181203 active : true
182204 autoCorrect : true
205+ NoEmptyFirstLineInMethodBlock :
206+ active : true
207+ autoCorrect : true
183208 NoLineBreakAfterElse :
184209 active : true
185210 autoCorrect : true
@@ -240,74 +265,73 @@ naming:
240265 ClassNaming :
241266 active : true
242267 classPattern : ' [A-Z$][a-zA-Z0-9$]*'
243- excludes : " **/test/**, **/androidTest/**, **/*.Test.kt, **/*.Spec.kt, **/*.Spek.kt"
268+ excludes : [' **/test/**', ' **/androidTest/**', ' **/*.Test.kt', ' **/*.Spec.kt', ' **/*.Spek.kt']
244269 ConstructorParameterNaming :
245270 active : true
246- excludes : " **/test/**, **/androidTest/**, **/*.Test.kt, **/*.Spec.kt, **/*.Spek.kt"
271+ excludes : [' **/test/**', ' **/androidTest/**', ' **/*.Test.kt', ' **/*.Spec.kt', ' **/*.Spek.kt']
247272 parameterPattern : ' [a-z][A-Za-z0-9]*'
248273 privateParameterPattern : ' [a-z][A-Za-z0-9]*'
249274 excludeClassPattern : ' $^'
250275 ignoreOverridden : true
251276 EnumNaming :
252277 active : true
253- excludes : " **/test/**, **/androidTest/**, **/*.Test.kt, **/*.Spec.kt, **/*.Spek.kt"
278+ excludes : [' **/test/**', ' **/androidTest/**', ' **/*.Test.kt', ' **/*.Spec.kt', ' **/*.Spek.kt']
254279 enumEntryPattern : ' ^[A-Z][_a-zA-Z0-9]*'
255280 ForbiddenClassName :
256281 active : true
257- excludes : " **/test/**, **/androidTest/**, **/*.Test.kt, **/*.Spec.kt, **/*.Spek.kt"
258- forbiddenName : ' '
282+ excludes : [' **/test/**', ' **/androidTest/**', ' **/*.Test.kt', ' **/*.Spec.kt', ' **/*.Spek.kt']
283+ forbiddenName : []
259284 FunctionMaxLength :
260285 active : true
261- excludes : " **/test/**, **/androidTest/**, **/*.Test.kt, **/*.Spec.kt, **/*.Spek.kt"
286+ excludes : [' **/test/**', ' **/androidTest/**', ' **/*.Test.kt', ' **/*.Spec.kt', ' **/*.Spek.kt']
262287 maximumFunctionNameLength : 30
263288 FunctionMinLength :
264- active : true
265- excludes : " **/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt"
266- minimumFunctionNameLength : 3
289+ active : false
267290 FunctionNaming :
268291 active : true
269- excludes : " **/test/**, **/androidTest/**, **/*.Test.kt, **/*.Spec.kt, **/*.Spek.kt"
292+ excludes : [' **/test/**', ' **/androidTest/**', ' **/*.Test.kt', ' **/*.Spec.kt', ' **/*.Spek.kt']
270293 functionPattern : ' ^([a-z$][a-zA-Z$0-9]*)|(`.*`)$'
271294 excludeClassPattern : ' $^'
272295 ignoreOverridden : true
273296 FunctionParameterNaming :
274297 active : true
275- excludes : " **/test/**, **/androidTest/**, **/*.Test.kt, **/*.Spec.kt, **/*.Spek.kt"
298+ excludes : [' **/test/**', ' **/androidTest/**', ' **/*.Test.kt', ' **/*.Spec.kt', ' **/*.Spek.kt']
276299 parameterPattern : ' [a-z][A-Za-z0-9]*'
277300 excludeClassPattern : ' $^'
278- ignoreOverriddenFunctions : true
301+ ignoreOverridden : true
279302 InvalidPackageDeclaration :
280303 active : true
281304 rootPackage : ' '
282305 MatchingDeclarationName :
283306 active : true
307+ mustBeFirst : true
284308 MemberNameEqualsClassName :
285309 active : false
286310 ObjectPropertyNaming :
287311 active : true
288- excludes : " **/test/**, **/androidTest/**, **/*.Test.kt, **/*.Spec.kt, **/*.Spek.kt"
312+ excludes : [' **/test/**', ' **/androidTest/**', ' **/*.Test.kt', ' **/*.Spec.kt', ' **/*.Spek.kt']
289313 constantPattern : ' [A-Za-z][_A-Za-z0-9]*'
290314 propertyPattern : ' [A-Za-z][_A-Za-z0-9]*'
291315 privatePropertyPattern : ' (_)?[A-Za-z][_A-Za-z0-9]*'
292316 PackageNaming :
293317 active : true
294- excludes : " **/test/**, **/androidTest/**, **/*.Test.kt, **/*.Spec.kt, **/*.Spek.kt"
318+ excludes : [' **/test/**', ' **/androidTest/**', ' **/*.Test.kt', ' **/*.Spec.kt', ' **/*.Spek.kt']
295319 packagePattern : ' ^[a-z]+(\.[a-z][A-Za-z0-9]*)*$'
296320 TopLevelPropertyNaming :
297321 active : true
298- excludes : " **/test/**, **/androidTest/**, **/*.Test.kt, **/*.Spec.kt, **/*.Spek.kt"
322+ excludes : [' **/test/**', ' **/androidTest/**', ' **/*.Test.kt', ' **/*.Spec.kt', ' **/*.Spek.kt']
299323 constantPattern : ' [A-Z][_A-Z0-9]*'
300324 propertyPattern : ' [A-Za-z][_A-Za-z0-9]*'
301325 privatePropertyPattern : ' _?[A-Za-z][_A-Za-z0-9]*'
302326 VariableMaxLength :
303327 active : true
304- excludes : " **/test/**, **/androidTest/**, **/*.Test.kt, **/*.Spec.kt, **/*.Spek.kt"
328+ excludes : [' **/test/**', ' **/androidTest/**', ' **/*.Test.kt', ' **/*.Spec.kt', ' **/*.Spek.kt']
305329 maximumVariableNameLength : 64
306330 VariableMinLength :
307331 active : false
308332 VariableNaming :
309333 active : true
310- excludes : " **/test/**, **/androidTest/**, **/*.Test.kt, **/*.Spec.kt, **/*.Spek.kt"
334+ excludes : [' **/test/**', ' **/androidTest/**', ' **/*.Test.kt', ' **/*.Spec.kt', ' **/*.Spek.kt']
311335 variablePattern : ' [a-z][A-Za-z0-9]*'
312336 privateVariablePattern : ' (_)?[a-z][A-Za-z0-9]*'
313337 excludeClassPattern : ' $^'
@@ -319,10 +343,10 @@ performance:
319343 active : true
320344 ForEachOnRange :
321345 active : true
322- excludes : " **/test/**, **/androidTest/**, **/*.Test.kt, **/*.Spec.kt, **/*.Spek.kt"
346+ excludes : [' **/test/**', ' **/androidTest/**', ' **/*.Test.kt', ' **/*.Spec.kt', ' **/*.Spek.kt']
323347 SpreadOperator :
324348 active : true
325- excludes : " **/test/**, **/androidTest/**, **/*.Test.kt, **/*.Spec.kt, **/*.Spek.kt"
349+ excludes : [' **/test/**', ' **/androidTest/**', ' **/*.Test.kt', ' **/*.Spec.kt', ' **/*.Spek.kt']
326350 UnnecessaryTemporaryInstantiation :
327351 active : true
328352
@@ -358,6 +382,10 @@ potential-bugs:
358382 active : true
359383 UnconditionalJumpStatementInLoop :
360384 active : true
385+ UnnecessaryNotNullOperator :
386+ active : false
387+ UnnecessarySafeCall :
388+ active : false
361389 UnreachableCode :
362390 active : true
363391 UnsafeCallOnNullableType :
@@ -381,25 +409,27 @@ style:
381409 active : true
382410 EqualsOnSignatureLine :
383411 active : true
412+ ExplicitCollectionElementAccessMethod :
413+ active : true
384414 ExplicitItLambdaParameter :
385415 active : true
386416 ExpressionBodySyntax :
387417 active : true
388418 includeLineWrapping : false
389419 ForbiddenComment :
390420 active : true
391- values : ' TODO:, FIXME:, STOPSHIP:'
392- allowedPatterns : " "
421+ values : [ 'TODO:', ' FIXME:', ' STOPSHIP:']
422+ allowedPatterns : ' '
393423 ForbiddenImport :
394424 active : true
395- imports : ' '
396- forbiddenPatterns : " "
425+ imports : []
426+ forbiddenPatterns : ' '
397427 ForbiddenMethodCall :
398428 active : true
399- methods : ' '
429+ methods : []
400430 ForbiddenPublicDataClass :
401431 active : true
402- ignorePackages : ' *.internal, *.internal.*'
432+ ignorePackages : [ '*.internal', ' *.internal.*']
403433 ForbiddenVoid :
404434 active : true
405435 ignoreOverridden : true
@@ -408,7 +438,7 @@ style:
408438 active : true
409439 ignoreOverridableFunction : true
410440 excludedFunctions : ' describeContents'
411- excludeAnnotatedFunction : " dagger.Provides"
441+ excludeAnnotatedFunction : [' dagger.Provides']
412442 LibraryCodeMustSpecifyReturnType :
413443 active : true
414444 LoopWithTooManyJumpStatements :
@@ -464,8 +494,7 @@ style:
464494 UnderscoresInNumericLiterals :
465495 active : false
466496 UnnecessaryAbstractClass :
467- active : true
468- excludeAnnotatedClasses : " dagger.Module"
497+ active : false
469498 UnnecessaryAnnotationUseSiteTarget :
470499 active : true
471500 UnnecessaryApply :
@@ -484,7 +513,7 @@ style:
484513 active : true
485514 UnusedPrivateMember :
486515 active : true
487- allowedNames : " (_|ignored|expected|serialVersionUID)"
516+ allowedNames : ' (_|ignored|expected|serialVersionUID)'
488517 UseArrayLiteralsInAnnotations :
489518 active : true
490519 UseCheckOrError :
0 commit comments