Update detekt.yml

This commit is contained in:
Mygod 2020-05-24 05:48:04 +08:00
parent fab367a5ef
commit f8d96eec97
3 changed files with 85 additions and 56 deletions

@ -1 +1 @@
Subproject commit 59b8f4fc46c7be399dad0620121a89efa656dc9c Subproject commit ca361195f584f3904c9440ac012bd4e8611f7b52

View file

@ -1,4 +1,4 @@
# https://github.com/arturbosch/detekt/blob/1.3.1/detekt-cli/src/main/resources/default-detekt-config.yml # https://github.com/arturbosch/detekt/blob/1.7.1/detekt-cli/src/main/resources/default-detekt-config.yml
comments: comments:
active: false active: false
@ -12,16 +12,15 @@ complexity:
active: true active: true
threshold: 10 threshold: 10
includeStaticDeclarations: false includeStaticDeclarations: false
includePrivateDeclarations: false
ComplexMethod: ComplexMethod:
active: true active: true
threshold: 15 threshold: 15
ignoreSingleWhenExpression: false ignoreSingleWhenExpression: false
ignoreSimpleWhenEntries: false ignoreSimpleWhenEntries: false
ignoreNestingFunctions: false ignoreNestingFunctions: false
nestingFunctions: run,let,apply,with,also,use,forEach,isNotNull,ifNull
LabeledExpression: LabeledExpression:
active: false active: false
ignoredLabels: ""
LargeClass: LargeClass:
active: true active: true
threshold: 600 threshold: 600
@ -30,8 +29,11 @@ complexity:
threshold: 60 threshold: 60
LongParameterList: LongParameterList:
active: true active: true
threshold: 6 functionThreshold: 6
constructorThreshold: 7
ignoreDefaultParameters: true ignoreDefaultParameters: true
ignoreDataClasses: true
ignoreAnnotated: []
MethodOverloading: MethodOverloading:
active: false active: false
NestedBlockDepth: NestedBlockDepth:
@ -39,14 +41,14 @@ complexity:
threshold: 4 threshold: 4
StringLiteralDuplication: StringLiteralDuplication:
active: true active: true
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" excludes: ['**/test/**', '**/androidTest/**', '**/*.Test.kt', '**/*.Spec.kt', '**/*.Spek.kt']
threshold: 3 threshold: 3
ignoreAnnotation: true ignoreAnnotation: true
excludeStringsWithLessThan5Characters: true excludeStringsWithLessThan5Characters: true
ignoreStringsRegex: '$^' ignoreStringsRegex: '$^'
TooManyFunctions: TooManyFunctions:
active: true active: true
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" excludes: ['**/test/**', '**/androidTest/**', '**/*.Test.kt', '**/*.Spec.kt', '**/*.Spek.kt']
thresholdInFiles: 11 thresholdInFiles: 11
thresholdInClasses: 11 thresholdInClasses: 11
thresholdInInterfaces: 11 thresholdInInterfaces: 11
@ -56,11 +58,18 @@ complexity:
ignorePrivate: false ignorePrivate: false
ignoreOverridden: true ignoreOverridden: true
coroutines:
active: true
GlobalCoroutineUsage:
active: false
RedundantSuspendModifier:
active: true
empty-blocks: empty-blocks:
active: true active: true
EmptyCatchBlock: EmptyCatchBlock:
active: true active: true
allowedExceptionNameRegex: "^(_|(ignore|expected).*)" allowedExceptionNameRegex: '^(_|(ignore|expected).*)'
EmptyClassBlock: EmptyClassBlock:
active: true active: true
EmptyDefaultConstructor: EmptyDefaultConstructor:
@ -75,7 +84,7 @@ empty-blocks:
active: true active: true
EmptyFunctionBlock: EmptyFunctionBlock:
active: true active: true
ignoreOverriddenFunctions: true ignoreOverridden: true
EmptyIfBlock: EmptyIfBlock:
active: true active: true
EmptyInitBlock: EmptyInitBlock:
@ -84,6 +93,8 @@ empty-blocks:
active: true active: true
EmptySecondaryConstructor: EmptySecondaryConstructor:
active: true active: true
EmptyTryBlock:
active: true
EmptyWhenBlock: EmptyWhenBlock:
active: true active: true
EmptyWhileBlock: EmptyWhileBlock:
@ -93,7 +104,7 @@ exceptions:
active: true active: true
ExceptionRaisedInUnexpectedLocation: ExceptionRaisedInUnexpectedLocation:
active: true active: true
methodNames: 'toString,hashCode,equals,finalize' methodNames: [toString, hashCode, equals, finalize]
InstanceOfCheckForException: InstanceOfCheckForException:
active: false active: false
NotImplementedDeclaration: NotImplementedDeclaration:
@ -107,20 +118,27 @@ exceptions:
ignoreLabeled: true ignoreLabeled: true
SwallowedException: SwallowedException:
active: true active: true
ignoredExceptionTypes: 'InterruptedException,NumberFormatException,ParseException,MalformedURLException' ignoredExceptionTypes:
allowedExceptionNameRegex: "^(_|(ignore|expected).*)" - InterruptedException
- NumberFormatException
- ParseException
- MalformedURLException
allowedExceptionNameRegex: '^(_|(ignore|expected).*)'
ThrowingExceptionFromFinally: ThrowingExceptionFromFinally:
active: false active: false
ThrowingExceptionInMain: ThrowingExceptionInMain:
active: true active: true
ThrowingExceptionsWithoutMessageOrCause: ThrowingExceptionsWithoutMessageOrCause:
active: true active: true
exceptions: 'IllegalArgumentException,IllegalStateException,IOException' exceptions:
- IllegalArgumentException
- IllegalStateException
- IOException
ThrowingNewInstanceOfSameException: ThrowingNewInstanceOfSameException:
active: true active: true
TooGenericExceptionCaught: TooGenericExceptionCaught:
active: true active: true
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" excludes: ['**/test/**', '**/androidTest/**', '**/*.Test.kt', '**/*.Spec.kt', '**/*.Spek.kt']
exceptionNames: exceptionNames:
- ArrayIndexOutOfBoundsException - ArrayIndexOutOfBoundsException
- Error - Error
@ -130,7 +148,7 @@ exceptions:
- IndexOutOfBoundsException - IndexOutOfBoundsException
- RuntimeException - RuntimeException
- Throwable - Throwable
allowedExceptionNameRegex: "^(_|(ignore|expected).*)" allowedExceptionNameRegex: '^(_|(ignore|expected).*)'
TooGenericExceptionThrown: TooGenericExceptionThrown:
active: true active: true
exceptionNames: exceptionNames:
@ -151,11 +169,15 @@ formatting:
autoCorrect: true autoCorrect: true
CommentSpacing: CommentSpacing:
active: false active: false
EnumEntryNameCase:
active: true
autoCorrect: false
Filename: Filename:
active: true active: true
FinalNewline: FinalNewline:
active: true active: true
autoCorrect: true autoCorrect: true
insertFinalNewLine: true
ImportOrdering: ImportOrdering:
active: false active: false
Indentation: Indentation:
@ -180,6 +202,9 @@ formatting:
NoEmptyClassBody: NoEmptyClassBody:
active: true active: true
autoCorrect: true autoCorrect: true
NoEmptyFirstLineInMethodBlock:
active: true
autoCorrect: true
NoLineBreakAfterElse: NoLineBreakAfterElse:
active: true active: true
autoCorrect: true autoCorrect: true
@ -240,74 +265,73 @@ naming:
ClassNaming: ClassNaming:
active: true active: true
classPattern: '[A-Z$][a-zA-Z0-9$]*' classPattern: '[A-Z$][a-zA-Z0-9$]*'
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" excludes: ['**/test/**', '**/androidTest/**', '**/*.Test.kt', '**/*.Spec.kt', '**/*.Spek.kt']
ConstructorParameterNaming: ConstructorParameterNaming:
active: true active: true
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" excludes: ['**/test/**', '**/androidTest/**', '**/*.Test.kt', '**/*.Spec.kt', '**/*.Spek.kt']
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 ignoreOverridden: true
EnumNaming: EnumNaming:
active: true active: true
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" excludes: ['**/test/**', '**/androidTest/**', '**/*.Test.kt', '**/*.Spec.kt', '**/*.Spek.kt']
enumEntryPattern: '^[A-Z][_a-zA-Z0-9]*' enumEntryPattern: '^[A-Z][_a-zA-Z0-9]*'
ForbiddenClassName: ForbiddenClassName:
active: true active: true
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" excludes: ['**/test/**', '**/androidTest/**', '**/*.Test.kt', '**/*.Spec.kt', '**/*.Spek.kt']
forbiddenName: '' forbiddenName: []
FunctionMaxLength: FunctionMaxLength:
active: true active: true
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" excludes: ['**/test/**', '**/androidTest/**', '**/*.Test.kt', '**/*.Spec.kt', '**/*.Spek.kt']
maximumFunctionNameLength: 30 maximumFunctionNameLength: 30
FunctionMinLength: FunctionMinLength:
active: true active: false
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt"
minimumFunctionNameLength: 3
FunctionNaming: FunctionNaming:
active: true active: true
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" excludes: ['**/test/**', '**/androidTest/**', '**/*.Test.kt', '**/*.Spec.kt', '**/*.Spek.kt']
functionPattern: '^([a-z$][a-zA-Z$0-9]*)|(`.*`)$' functionPattern: '^([a-z$][a-zA-Z$0-9]*)|(`.*`)$'
excludeClassPattern: '$^' excludeClassPattern: '$^'
ignoreOverridden: true ignoreOverridden: true
FunctionParameterNaming: FunctionParameterNaming:
active: true active: true
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" excludes: ['**/test/**', '**/androidTest/**', '**/*.Test.kt', '**/*.Spec.kt', '**/*.Spek.kt']
parameterPattern: '[a-z][A-Za-z0-9]*' parameterPattern: '[a-z][A-Za-z0-9]*'
excludeClassPattern: '$^' excludeClassPattern: '$^'
ignoreOverriddenFunctions: true ignoreOverridden: true
InvalidPackageDeclaration: InvalidPackageDeclaration:
active: true active: true
rootPackage: '' rootPackage: ''
MatchingDeclarationName: MatchingDeclarationName:
active: true active: true
mustBeFirst: true
MemberNameEqualsClassName: MemberNameEqualsClassName:
active: false active: false
ObjectPropertyNaming: ObjectPropertyNaming:
active: true active: true
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" excludes: ['**/test/**', '**/androidTest/**', '**/*.Test.kt', '**/*.Spec.kt', '**/*.Spek.kt']
constantPattern: '[A-Za-z][_A-Za-z0-9]*' constantPattern: '[A-Za-z][_A-Za-z0-9]*'
propertyPattern: '[A-Za-z][_A-Za-z0-9]*' propertyPattern: '[A-Za-z][_A-Za-z0-9]*'
privatePropertyPattern: '(_)?[A-Za-z][_A-Za-z0-9]*' privatePropertyPattern: '(_)?[A-Za-z][_A-Za-z0-9]*'
PackageNaming: PackageNaming:
active: true active: true
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" excludes: ['**/test/**', '**/androidTest/**', '**/*.Test.kt', '**/*.Spec.kt', '**/*.Spek.kt']
packagePattern: '^[a-z]+(\.[a-z][A-Za-z0-9]*)*$' packagePattern: '^[a-z]+(\.[a-z][A-Za-z0-9]*)*$'
TopLevelPropertyNaming: TopLevelPropertyNaming:
active: true active: true
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" excludes: ['**/test/**', '**/androidTest/**', '**/*.Test.kt', '**/*.Spec.kt', '**/*.Spek.kt']
constantPattern: '[A-Z][_A-Z0-9]*' constantPattern: '[A-Z][_A-Z0-9]*'
propertyPattern: '[A-Za-z][_A-Za-z0-9]*' propertyPattern: '[A-Za-z][_A-Za-z0-9]*'
privatePropertyPattern: '_?[A-Za-z][_A-Za-z0-9]*' privatePropertyPattern: '_?[A-Za-z][_A-Za-z0-9]*'
VariableMaxLength: VariableMaxLength:
active: true active: true
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" excludes: ['**/test/**', '**/androidTest/**', '**/*.Test.kt', '**/*.Spec.kt', '**/*.Spek.kt']
maximumVariableNameLength: 64 maximumVariableNameLength: 64
VariableMinLength: VariableMinLength:
active: false active: false
VariableNaming: VariableNaming:
active: true active: true
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" excludes: ['**/test/**', '**/androidTest/**', '**/*.Test.kt', '**/*.Spec.kt', '**/*.Spek.kt']
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: '$^'
@ -319,10 +343,10 @@ performance:
active: true active: true
ForEachOnRange: ForEachOnRange:
active: true active: true
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" excludes: ['**/test/**', '**/androidTest/**', '**/*.Test.kt', '**/*.Spec.kt', '**/*.Spek.kt']
SpreadOperator: SpreadOperator:
active: true active: true
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt" excludes: ['**/test/**', '**/androidTest/**', '**/*.Test.kt', '**/*.Spec.kt', '**/*.Spek.kt']
UnnecessaryTemporaryInstantiation: UnnecessaryTemporaryInstantiation:
active: true active: true
@ -358,6 +382,10 @@ potential-bugs:
active: true active: true
UnconditionalJumpStatementInLoop: UnconditionalJumpStatementInLoop:
active: true active: true
UnnecessaryNotNullOperator:
active: false
UnnecessarySafeCall:
active: false
UnreachableCode: UnreachableCode:
active: true active: true
UnsafeCallOnNullableType: UnsafeCallOnNullableType:
@ -381,6 +409,8 @@ style:
active: true active: true
EqualsOnSignatureLine: EqualsOnSignatureLine:
active: true active: true
ExplicitCollectionElementAccessMethod:
active: true
ExplicitItLambdaParameter: ExplicitItLambdaParameter:
active: true active: true
ExpressionBodySyntax: ExpressionBodySyntax:
@ -388,18 +418,18 @@ style:
includeLineWrapping: false includeLineWrapping: false
ForbiddenComment: ForbiddenComment:
active: true active: true
values: 'TODO:,FIXME:,STOPSHIP:' values: ['TODO:', 'FIXME:', 'STOPSHIP:']
allowedPatterns: "" allowedPatterns: ''
ForbiddenImport: ForbiddenImport:
active: true active: true
imports: '' imports: []
forbiddenPatterns: "" forbiddenPatterns: ''
ForbiddenMethodCall: ForbiddenMethodCall:
active: true active: true
methods: '' methods: []
ForbiddenPublicDataClass: ForbiddenPublicDataClass:
active: true active: true
ignorePackages: '*.internal,*.internal.*' ignorePackages: ['*.internal', '*.internal.*']
ForbiddenVoid: ForbiddenVoid:
active: true active: true
ignoreOverridden: true ignoreOverridden: true
@ -408,7 +438,7 @@ style:
active: true active: true
ignoreOverridableFunction: true ignoreOverridableFunction: true
excludedFunctions: 'describeContents' excludedFunctions: 'describeContents'
excludeAnnotatedFunction: "dagger.Provides" excludeAnnotatedFunction: ['dagger.Provides']
LibraryCodeMustSpecifyReturnType: LibraryCodeMustSpecifyReturnType:
active: true active: true
LoopWithTooManyJumpStatements: LoopWithTooManyJumpStatements:
@ -464,8 +494,7 @@ style:
UnderscoresInNumericLiterals: UnderscoresInNumericLiterals:
active: false active: false
UnnecessaryAbstractClass: UnnecessaryAbstractClass:
active: true active: false
excludeAnnotatedClasses: "dagger.Module"
UnnecessaryAnnotationUseSiteTarget: UnnecessaryAnnotationUseSiteTarget:
active: true active: true
UnnecessaryApply: UnnecessaryApply:
@ -484,7 +513,7 @@ style:
active: true active: true
UnusedPrivateMember: UnusedPrivateMember:
active: true active: true
allowedNames: "(_|ignored|expected|serialVersionUID)" allowedNames: '(_|ignored|expected|serialVersionUID)'
UseArrayLiteralsInAnnotations: UseArrayLiteralsInAnnotations:
active: true active: true
UseCheckOrError: UseCheckOrError:

Binary file not shown.