v2ray-plugin-android/detekt.yml

506 lines
12 KiB
YAML
Raw Normal View History

2020-01-18 09:40:04 +08:00
# https://github.com/arturbosch/detekt/blob/1.3.1/detekt-cli/src/main/resources/default-detekt-config.yml
2019-01-11 09:44:36 +08:00
comments:
active: false
complexity:
active: true
ComplexCondition:
active: true
threshold: 4
ComplexInterface:
active: true
threshold: 10
includeStaticDeclarations: false
ComplexMethod:
active: true
2020-01-18 09:40:04 +08:00
threshold: 15
2019-01-11 09:44:36 +08:00
ignoreSingleWhenExpression: false
2020-01-18 09:40:04 +08:00
ignoreSimpleWhenEntries: false
ignoreNestingFunctions: false
nestingFunctions: run,let,apply,with,also,use,forEach,isNotNull,ifNull
2019-01-11 09:44:36 +08:00
LabeledExpression:
active: false
2020-01-18 09:40:04 +08:00
ignoredLabels: ""
2019-01-11 09:44:36 +08:00
LargeClass:
active: true
2020-01-18 09:40:04 +08:00
threshold: 600
2019-01-11 09:44:36 +08:00
LongMethod:
active: true
2020-01-18 09:40:04 +08:00
threshold: 60
2019-01-11 09:44:36 +08:00
LongParameterList:
active: true
threshold: 6
ignoreDefaultParameters: true
MethodOverloading:
active: false
NestedBlockDepth:
active: true
threshold: 4
StringLiteralDuplication:
active: true
2020-01-18 09:40:04 +08:00
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt"
2019-01-11 09:44:36 +08:00
threshold: 3
ignoreAnnotation: true
excludeStringsWithLessThan5Characters: true
ignoreStringsRegex: '$^'
TooManyFunctions:
active: true
2020-01-18 09:40:04 +08:00
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt"
2019-01-11 09:44:36 +08:00
thresholdInFiles: 11
thresholdInClasses: 11
thresholdInInterfaces: 11
thresholdInObjects: 11
thresholdInEnums: 11
ignoreDeprecated: true
ignorePrivate: false
2020-01-18 09:40:04 +08:00
ignoreOverridden: true
2019-01-11 09:44:36 +08:00
empty-blocks:
active: true
EmptyCatchBlock:
active: true
allowedExceptionNameRegex: "^(_|(ignore|expected).*)"
EmptyClassBlock:
active: true
EmptyDefaultConstructor:
active: true
EmptyDoWhileBlock:
active: true
EmptyElseBlock:
active: true
EmptyFinallyBlock:
active: true
EmptyForBlock:
active: true
EmptyFunctionBlock:
active: true
2020-01-18 09:40:04 +08:00
ignoreOverriddenFunctions: true
2019-01-11 09:44:36 +08:00
EmptyIfBlock:
active: true
EmptyInitBlock:
active: true
EmptyKtFile:
active: true
EmptySecondaryConstructor:
active: true
EmptyWhenBlock:
active: true
EmptyWhileBlock:
active: true
exceptions:
active: true
ExceptionRaisedInUnexpectedLocation:
active: true
methodNames: 'toString,hashCode,equals,finalize'
InstanceOfCheckForException:
2020-01-18 09:40:04 +08:00
active: false
2019-01-11 09:44:36 +08:00
NotImplementedDeclaration:
active: true
PrintStackTrace:
active: false
RethrowCaughtException:
active: false
ReturnFromFinally:
active: true
2020-01-18 09:40:04 +08:00
ignoreLabeled: true
2019-01-11 09:44:36 +08:00
SwallowedException:
active: true
2020-01-18 09:40:04 +08:00
ignoredExceptionTypes: 'InterruptedException,NumberFormatException,ParseException,MalformedURLException'
allowedExceptionNameRegex: "^(_|(ignore|expected).*)"
2019-01-11 09:44:36 +08:00
ThrowingExceptionFromFinally:
active: false
ThrowingExceptionInMain:
active: true
ThrowingExceptionsWithoutMessageOrCause:
active: true
exceptions: 'IllegalArgumentException,IllegalStateException,IOException'
ThrowingNewInstanceOfSameException:
active: true
TooGenericExceptionCaught:
active: true
2020-01-18 09:40:04 +08:00
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt"
2019-01-11 09:44:36 +08:00
exceptionNames:
- ArrayIndexOutOfBoundsException
- Error
- Exception
- IllegalMonitorStateException
- NullPointerException
- IndexOutOfBoundsException
- RuntimeException
- Throwable
allowedExceptionNameRegex: "^(_|(ignore|expected).*)"
TooGenericExceptionThrown:
active: true
exceptionNames:
- Error
- Exception
- Throwable
- RuntimeException
formatting:
active: true
android: true
autoCorrect: true
2020-01-18 09:40:04 +08:00
AnnotationOnSeparateLine:
active: true
autoCorrect: true
2019-01-11 09:44:36 +08:00
ChainWrapping:
active: true
autoCorrect: true
CommentSpacing:
active: false
Filename:
active: true
FinalNewline:
active: true
autoCorrect: true
ImportOrdering:
active: false
Indentation:
active: true
autoCorrect: true
indentSize: 4
continuationIndentSize: 4
MaximumLineLength:
active: false
ModifierOrdering:
active: true
autoCorrect: true
2020-01-18 09:40:04 +08:00
MultiLineIfElse:
active: true
autoCorrect: true
2019-01-11 09:44:36 +08:00
NoBlankLineBeforeRbrace:
active: true
autoCorrect: true
NoConsecutiveBlankLines:
active: true
autoCorrect: true
NoEmptyClassBody:
active: true
autoCorrect: true
NoLineBreakAfterElse:
active: true
autoCorrect: true
NoLineBreakBeforeAssignment:
active: true
autoCorrect: true
NoMultipleSpaces:
active: false
NoSemicolons:
active: true
autoCorrect: true
NoTrailingSpaces:
active: true
autoCorrect: true
NoUnitReturn:
active: true
autoCorrect: true
NoUnusedImports:
active: true
autoCorrect: true
NoWildcardImports:
active: false
2020-01-18 09:40:04 +08:00
PackageName:
active: true
autoCorrect: true
2019-01-11 09:44:36 +08:00
ParameterListWrapping:
active: false
SpacingAroundColon:
active: true
autoCorrect: true
SpacingAroundComma:
active: true
autoCorrect: true
SpacingAroundCurly:
active: true
autoCorrect: true
2020-01-18 09:40:04 +08:00
SpacingAroundDot:
active: true
autoCorrect: true
2019-01-11 09:44:36 +08:00
SpacingAroundKeyword:
active: true
autoCorrect: true
SpacingAroundOperators:
active: true
autoCorrect: true
2020-01-18 09:40:04 +08:00
SpacingAroundParens:
active: true
autoCorrect: true
2019-01-11 09:44:36 +08:00
SpacingAroundRangeOperator:
active: true
autoCorrect: true
StringTemplate:
active: true
autoCorrect: true
naming:
active: true
ClassNaming:
active: true
classPattern: '[A-Z$][a-zA-Z0-9$]*'
2020-01-18 09:40:04 +08:00
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt"
2019-01-11 09:44:36 +08:00
ConstructorParameterNaming:
active: true
2020-01-18 09:40:04 +08:00
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt"
2019-01-11 09:44:36 +08:00
parameterPattern: '[a-z][A-Za-z0-9]*'
privateParameterPattern: '[a-z][A-Za-z0-9]*'
excludeClassPattern: '$^'
2020-01-18 09:40:04 +08:00
ignoreOverridden: true
2019-01-11 09:44:36 +08:00
EnumNaming:
active: true
2020-01-18 09:40:04 +08:00
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt"
2019-01-11 09:44:36 +08:00
enumEntryPattern: '^[A-Z][_a-zA-Z0-9]*'
ForbiddenClassName:
active: true
2020-01-18 09:40:04 +08:00
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt"
2019-01-11 09:44:36 +08:00
forbiddenName: ''
FunctionMaxLength:
active: true
2020-01-18 09:40:04 +08:00
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt"
2019-01-11 09:44:36 +08:00
maximumFunctionNameLength: 30
FunctionMinLength:
active: true
2020-01-18 09:40:04 +08:00
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt"
2019-01-11 09:44:36 +08:00
minimumFunctionNameLength: 3
FunctionNaming:
active: true
2020-01-18 09:40:04 +08:00
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt"
2019-01-11 09:44:36 +08:00
functionPattern: '^([a-z$][a-zA-Z$0-9]*)|(`.*`)$'
excludeClassPattern: '$^'
ignoreOverridden: true
FunctionParameterNaming:
active: true
2020-01-18 09:40:04 +08:00
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt"
2019-01-11 09:44:36 +08:00
parameterPattern: '[a-z][A-Za-z0-9]*'
excludeClassPattern: '$^'
2020-01-18 09:40:04 +08:00
ignoreOverriddenFunctions: true
InvalidPackageDeclaration:
active: true
rootPackage: ''
2019-01-11 09:44:36 +08:00
MatchingDeclarationName:
active: true
MemberNameEqualsClassName:
active: false
ObjectPropertyNaming:
active: true
2020-01-18 09:40:04 +08:00
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt"
2019-01-11 09:44:36 +08:00
constantPattern: '[A-Za-z][_A-Za-z0-9]*'
propertyPattern: '[A-Za-z][_A-Za-z0-9]*'
2020-01-18 09:40:04 +08:00
privatePropertyPattern: '(_)?[A-Za-z][_A-Za-z0-9]*'
2019-01-11 09:44:36 +08:00
PackageNaming:
active: true
2020-01-18 09:40:04 +08:00
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt"
packagePattern: '^[a-z]+(\.[a-z][A-Za-z0-9]*)*$'
2019-01-11 09:44:36 +08:00
TopLevelPropertyNaming:
active: true
2020-01-18 09:40:04 +08:00
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt"
2019-01-11 09:44:36 +08:00
constantPattern: '[A-Z][_A-Z0-9]*'
propertyPattern: '[A-Za-z][_A-Za-z0-9]*'
2020-01-18 09:40:04 +08:00
privatePropertyPattern: '_?[A-Za-z][_A-Za-z0-9]*'
2019-01-11 09:44:36 +08:00
VariableMaxLength:
active: true
2020-01-18 09:40:04 +08:00
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt"
2019-01-11 09:44:36 +08:00
maximumVariableNameLength: 64
VariableMinLength:
active: false
VariableNaming:
active: true
2020-01-18 09:40:04 +08:00
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt"
2019-01-11 09:44:36 +08:00
variablePattern: '[a-z][A-Za-z0-9]*'
privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*'
excludeClassPattern: '$^'
ignoreOverridden: true
performance:
active: true
2020-01-18 09:40:04 +08:00
ArrayPrimitive:
active: true
2019-01-11 09:44:36 +08:00
ForEachOnRange:
active: true
2020-01-18 09:40:04 +08:00
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt"
2019-01-11 09:44:36 +08:00
SpreadOperator:
active: true
2020-01-18 09:40:04 +08:00
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt"
2019-01-11 09:44:36 +08:00
UnnecessaryTemporaryInstantiation:
active: true
potential-bugs:
active: true
2020-01-18 09:40:04 +08:00
Deprecation:
active: true
2019-01-11 09:44:36 +08:00
DuplicateCaseInWhenExpression:
active: true
EqualsAlwaysReturnsTrueOrFalse:
active: true
EqualsWithHashCodeExist:
active: true
ExplicitGarbageCollectionCall:
active: true
2020-01-18 09:40:04 +08:00
HasPlatformType:
active: true
ImplicitDefaultLocale:
active: true
2019-01-11 09:44:36 +08:00
InvalidRange:
active: true
IteratorHasNextCallsNextMethod:
active: true
IteratorNotThrowingNoSuchElementException:
active: true
LateinitUsage:
active: false
2020-01-18 09:40:04 +08:00
MapGetWithNotNullAssertionOperator:
active: true
MissingWhenCase:
active: false
RedundantElseInWhen:
active: true
2019-01-11 09:44:36 +08:00
UnconditionalJumpStatementInLoop:
active: true
UnreachableCode:
active: true
UnsafeCallOnNullableType:
2020-01-18 09:40:04 +08:00
active: true
2019-01-11 09:44:36 +08:00
UnsafeCast:
active: false
UselessPostfixExpression:
active: true
WrongEqualsTypeParameter:
active: true
style:
active: true
CollapsibleIfStatements:
active: true
DataClassContainsFunctions:
active: false
2020-01-18 09:40:04 +08:00
DataClassShouldBeImmutable:
active: false
2019-01-11 09:44:36 +08:00
EqualsNullCall:
active: true
2020-01-18 09:40:04 +08:00
EqualsOnSignatureLine:
active: true
ExplicitItLambdaParameter:
active: true
2019-01-11 09:44:36 +08:00
ExpressionBodySyntax:
active: true
includeLineWrapping: false
ForbiddenComment:
active: true
values: 'TODO:,FIXME:,STOPSHIP:'
2020-01-18 09:40:04 +08:00
allowedPatterns: ""
2019-01-11 09:44:36 +08:00
ForbiddenImport:
active: true
imports: ''
2020-01-18 09:40:04 +08:00
forbiddenPatterns: ""
ForbiddenMethodCall:
active: true
methods: ''
ForbiddenPublicDataClass:
active: true
ignorePackages: '*.internal,*.internal.*'
2019-01-11 09:44:36 +08:00
ForbiddenVoid:
active: true
2020-01-18 09:40:04 +08:00
ignoreOverridden: true
ignoreUsageInGenerics: false
2019-01-11 09:44:36 +08:00
FunctionOnlyReturningConstant:
active: true
ignoreOverridableFunction: true
excludedFunctions: 'describeContents'
2020-01-18 09:40:04 +08:00
excludeAnnotatedFunction: "dagger.Provides"
LibraryCodeMustSpecifyReturnType:
active: true
2019-01-11 09:44:36 +08:00
LoopWithTooManyJumpStatements:
active: true
maxJumpCount: 1
MagicNumber:
active: false
MandatoryBracesIfStatements:
active: false
MaxLineLength:
active: true
maxLineLength: 120
excludePackageStatements: true
excludeImportStatements: true
excludeCommentStatements: true
MayBeConst:
active: true
ModifierOrder:
active: true
NestedClassesVisibility:
active: true
NewLineAtEndOfFile:
active: true
NoTabs:
active: true
OptionalAbstractKeyword:
active: true
OptionalUnit:
active: true
OptionalWhenBraces:
2020-01-18 09:40:04 +08:00
active: false
2019-01-11 09:44:36 +08:00
PreferToOverPairSyntax:
active: false
ProtectedMemberInFinalClass:
active: true
2020-01-18 09:40:04 +08:00
RedundantExplicitType:
active: true
2019-01-11 09:44:36 +08:00
RedundantVisibilityModifierRule:
active: true
ReturnCount:
active: false
SafeCast:
active: true
SerialVersionUIDInSerializableClass:
active: true
SpacingBetweenPackageAndImports:
active: true
ThrowsCount:
active: true
max: 2
TrailingWhitespace:
active: true
2020-01-18 09:40:04 +08:00
UnderscoresInNumericLiterals:
active: false
2019-01-11 09:44:36 +08:00
UnnecessaryAbstractClass:
active: true
excludeAnnotatedClasses: "dagger.Module"
2020-01-18 09:40:04 +08:00
UnnecessaryAnnotationUseSiteTarget:
active: true
UnnecessaryApply:
active: true
2019-01-11 09:44:36 +08:00
UnnecessaryInheritance:
active: true
UnnecessaryLet:
active: true
UnnecessaryParentheses:
active: true
UntilInsteadOfRangeTo:
active: true
UnusedImports:
active: true
2020-01-18 09:40:04 +08:00
UnusedPrivateClass:
active: true
2019-01-11 09:44:36 +08:00
UnusedPrivateMember:
active: true
allowedNames: "(_|ignored|expected|serialVersionUID)"
2020-01-18 09:40:04 +08:00
UseArrayLiteralsInAnnotations:
active: true
UseCheckOrError:
active: true
2019-01-11 09:44:36 +08:00
UseDataClass:
active: false
2020-01-18 09:40:04 +08:00
UseIfInsteadOfWhen:
active: false
UseRequire:
active: true
UselessCallOnNotNull:
active: true
2019-01-11 09:44:36 +08:00
UtilityClassWithPublicConstructor:
active: true
VarCouldBeVal:
2020-01-18 09:40:04 +08:00
active: true
2019-01-11 09:44:36 +08:00
WildcardImport:
active: false