v2ray-plugin-android/detekt.yml

535 lines
13 KiB
YAML
Raw Permalink Normal View History

2020-05-24 05:48:04 +08:00
# https://github.com/arturbosch/detekt/blob/1.7.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
2020-05-24 05:48:04 +08:00
includePrivateDeclarations: false
2019-01-11 09:44:36 +08:00
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
2019-01-11 09:44:36 +08:00
LabeledExpression:
active: false
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
2020-05-24 05:48:04 +08:00
functionThreshold: 6
constructorThreshold: 7
2019-01-11 09:44:36 +08:00
ignoreDefaultParameters: true
2020-05-24 05:48:04 +08:00
ignoreDataClasses: true
ignoreAnnotated: []
2019-01-11 09:44:36 +08:00
MethodOverloading:
active: false
NestedBlockDepth:
active: true
threshold: 4
StringLiteralDuplication:
active: true
2020-05-24 05:48: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-05-24 05:48: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
2020-05-24 05:48:04 +08:00
coroutines:
active: true
GlobalCoroutineUsage:
active: false
RedundantSuspendModifier:
active: true
2019-01-11 09:44:36 +08:00
empty-blocks:
active: true
EmptyCatchBlock:
active: true
2020-05-24 05:48:04 +08:00
allowedExceptionNameRegex: '^(_|(ignore|expected).*)'
2019-01-11 09:44:36 +08:00
EmptyClassBlock:
active: true
EmptyDefaultConstructor:
active: true
EmptyDoWhileBlock:
active: true
EmptyElseBlock:
active: true
EmptyFinallyBlock:
active: true
EmptyForBlock:
active: true
EmptyFunctionBlock:
active: true
2020-05-24 05:48:04 +08:00
ignoreOverridden: true
2019-01-11 09:44:36 +08:00
EmptyIfBlock:
active: true
EmptyInitBlock:
active: true
EmptyKtFile:
active: true
EmptySecondaryConstructor:
active: true
2020-05-24 05:48:04 +08:00
EmptyTryBlock:
active: true
2019-01-11 09:44:36 +08:00
EmptyWhenBlock:
active: true
EmptyWhileBlock:
active: true
exceptions:
active: true
ExceptionRaisedInUnexpectedLocation:
active: true
2020-05-24 05:48:04 +08:00
methodNames: [toString, hashCode, equals, finalize]
2019-01-11 09:44:36 +08:00
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-05-24 05:48: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
2020-05-24 05:48:04 +08:00
exceptions:
- IllegalArgumentException
- IllegalStateException
- IOException
2019-01-11 09:44:36 +08:00
ThrowingNewInstanceOfSameException:
active: true
TooGenericExceptionCaught:
active: true
2020-05-24 05:48:04 +08:00
excludes: ['**/test/**', '**/androidTest/**', '**/*.Test.kt', '**/*.Spec.kt', '**/*.Spek.kt']
2019-01-11 09:44:36 +08:00
exceptionNames:
2020-05-24 05:48:04 +08:00
- ArrayIndexOutOfBoundsException
- Error
- Exception
- IllegalMonitorStateException
- NullPointerException
- IndexOutOfBoundsException
- RuntimeException
- Throwable
allowedExceptionNameRegex: '^(_|(ignore|expected).*)'
2019-01-11 09:44:36 +08:00
TooGenericExceptionThrown:
active: true
exceptionNames:
2020-05-24 05:48:04 +08:00
- Error
- Exception
- Throwable
- RuntimeException
2019-01-11 09:44:36 +08:00
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
2020-05-24 05:48:04 +08:00
EnumEntryNameCase:
active: true
autoCorrect: false
2019-01-11 09:44:36 +08:00
Filename:
active: true
FinalNewline:
active: true
autoCorrect: true
2020-05-24 05:48:04 +08:00
insertFinalNewLine: true
2019-01-11 09:44:36 +08:00
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
2020-05-24 05:48:04 +08:00
NoEmptyFirstLineInMethodBlock:
active: true
autoCorrect: true
2019-01-11 09:44:36 +08:00
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-05-24 05:48:04 +08:00
excludes: ['**/test/**', '**/androidTest/**', '**/*.Test.kt', '**/*.Spec.kt', '**/*.Spek.kt']
2019-01-11 09:44:36 +08:00
ConstructorParameterNaming:
active: true
2020-05-24 05:48: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-05-24 05:48: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-05-24 05:48:04 +08:00
excludes: ['**/test/**', '**/androidTest/**', '**/*.Test.kt', '**/*.Spec.kt', '**/*.Spek.kt']
forbiddenName: []
2019-01-11 09:44:36 +08:00
FunctionMaxLength:
active: true
2020-05-24 05:48:04 +08:00
excludes: ['**/test/**', '**/androidTest/**', '**/*.Test.kt', '**/*.Spec.kt', '**/*.Spek.kt']
2019-01-11 09:44:36 +08:00
maximumFunctionNameLength: 30
FunctionMinLength:
2020-05-24 05:48:04 +08:00
active: false
2019-01-11 09:44:36 +08:00
FunctionNaming:
active: true
2020-05-24 05:48: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-05-24 05:48: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-05-24 05:48:04 +08:00
ignoreOverridden: true
2020-01-18 09:40:04 +08:00
InvalidPackageDeclaration:
active: true
rootPackage: ''
2019-01-11 09:44:36 +08:00
MatchingDeclarationName:
active: true
2020-05-24 05:48:04 +08:00
mustBeFirst: true
2019-01-11 09:44:36 +08:00
MemberNameEqualsClassName:
active: false
ObjectPropertyNaming:
active: true
2020-05-24 05:48: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-05-24 05:48:04 +08:00
excludes: ['**/test/**', '**/androidTest/**', '**/*.Test.kt', '**/*.Spec.kt', '**/*.Spek.kt']
2020-01-18 09:40:04 +08:00
packagePattern: '^[a-z]+(\.[a-z][A-Za-z0-9]*)*$'
2019-01-11 09:44:36 +08:00
TopLevelPropertyNaming:
active: true
2020-05-24 05:48: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-05-24 05:48: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-05-24 05:48: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-05-24 05:48:04 +08:00
excludes: ['**/test/**', '**/androidTest/**', '**/*.Test.kt', '**/*.Spec.kt', '**/*.Spek.kt']
2019-01-11 09:44:36 +08:00
SpreadOperator:
active: true
2020-05-24 05:48: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
2020-05-24 05:48:04 +08:00
UnnecessaryNotNullOperator:
active: false
UnnecessarySafeCall:
active: false
2019-01-11 09:44:36 +08:00
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
2020-05-24 05:48:04 +08:00
ExplicitCollectionElementAccessMethod:
active: true
2020-01-18 09:40:04 +08:00
ExplicitItLambdaParameter:
active: true
2019-01-11 09:44:36 +08:00
ExpressionBodySyntax:
active: true
includeLineWrapping: false
ForbiddenComment:
active: true
2020-05-24 05:48:04 +08:00
values: ['TODO:', 'FIXME:', 'STOPSHIP:']
allowedPatterns: ''
2019-01-11 09:44:36 +08:00
ForbiddenImport:
active: true
2020-05-24 05:48:04 +08:00
imports: []
forbiddenPatterns: ''
2020-01-18 09:40:04 +08:00
ForbiddenMethodCall:
active: true
2020-05-24 05:48:04 +08:00
methods: []
2020-01-18 09:40:04 +08:00
ForbiddenPublicDataClass:
active: true
2020-05-24 05:48:04 +08:00
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-05-24 05:48:04 +08:00
excludeAnnotatedFunction: ['dagger.Provides']
2020-01-18 09:40:04 +08:00
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:
2020-05-24 05:48:04 +08:00
active: false
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
2020-05-24 05:48:04 +08:00
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