Merge pull request #74 from TouchInstinct/detekt_rules

New Detekt rules
This commit is contained in:
Denis Karmyshakov 2018-11-08 13:11:36 +03:00 committed by GitHub
commit c3d2204e7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 82 additions and 35 deletions

View File

@ -2,13 +2,12 @@ autoCorrect: true
failFast: false
build:
warningThreshold: 1
failThreshold: 100500
# maxIssues: 10
weights:
complexity: 2
formatting: 0
LongParameterList: 1
comments: 0.5
# complexity: 2
# LongParameterList: 1
# style: 1
# comments: 1
processors:
active: true
@ -64,6 +63,8 @@ complexity:
ComplexMethod:
active: true
threshold: 10
ignoreSingleWhenExpression: false
ignoreSimpleWhenEntries: false
LabeledExpression:
active: true
LargeClass:
@ -95,11 +96,14 @@ complexity:
thresholdInInterfaces: 20
thresholdInObjects: 20
thresholdInEnums: 20
ignoreDeprecated: false
ignorePrivate: false
empty-blocks:
active: true
EmptyCatchBlock:
active: true
allowedExceptionNameRegex: "^(_|(ignore|expected).*)"
EmptyClassBlock:
active: true
EmptyDefaultConstructor:
@ -114,6 +118,7 @@ empty-blocks:
active: true
EmptyFunctionBlock:
active: true
ignoreOverriddenFunctions: false
EmptyIfBlock:
active: true
EmptyInitBlock:
@ -155,7 +160,7 @@ exceptions:
active: false
TooGenericExceptionCaught:
active: true
exceptions:
exceptionNames:
- ArrayIndexOutOfBoundsException
- Error
- Exception
@ -164,12 +169,12 @@ exceptions:
- IndexOutOfBoundsException
- RuntimeException
- Throwable
allowedExceptionNameRegex: "^(_|(ignore|expected).*)"
TooGenericExceptionThrown:
active: true
exceptions:
exceptionNames:
- Error
- Exception
- NullPointerException
- Throwable
- RuntimeException
@ -177,10 +182,15 @@ naming:
active: true
ClassNaming:
active: true
classPattern: '^[A-Z][a-zA-Z0-9]*$'
classPattern: '[A-Z$][a-zA-Z0-9$]*'
ConstructorParameterNaming:
active: true
parameterPattern: '[a-z][A-Za-z0-9]*'
privateParameterPattern: '[a-z][A-Za-z0-9]*'
excludeClassPattern: '$^'
EnumNaming:
active: true
enumEntryPattern: '^[A-Z][a-zA-Z0-9_]*$'
enumEntryPattern: '^[A-Z][_a-zA-Z0-9]*'
ForbiddenClassName:
active: false
forbiddenName: ''
@ -192,7 +202,14 @@ naming:
minimumFunctionNameLength: 3
FunctionNaming:
active: true
functionPattern: '^[a-z][a-z0-9][a-zA-Z0-9_]*$'
functionPattern: '^([a-z$][a-zA-Z$0-9]*)|(`.*`)$'
excludeClassPattern: '$^'
ignoreOverridden: true
FunctionParameterNaming:
active: true
parameterPattern: '[a-z][A-Za-z0-9]*'
excludeClassPattern: '$^'
ignoreOverriddenFunctions: true
MatchingDeclarationName:
active: true
MemberNameEqualsClassName:
@ -200,15 +217,17 @@ naming:
ignoreOverriddenFunction: true
ObjectPropertyNaming:
active: true
constantPattern: '[A-Za-z][_A-Za-z0-9]*'
propertyPattern: '[A-Za-z][_A-Za-z0-9]*'
privatePropertyPattern: '(_)?[A-Za-z][A-Za-z0-9]*'
PackageNaming:
active: true
packagePattern: '^[a-z]+(\.[a-z][a-z0-9]*)*$'
TopLevelPropertyNaming:
active: true
constantPattern: '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'
propertyPattern: '^[a-z][a-z0-9][a-zA-Z0-9]*$'
privatePropertyPattern: '^[a-z][a-z0-9][a-zA-Z0-9]*$'
constantPattern: '[A-Z][_A-Z0-9]*'
propertyPattern: '[A-Za-z][_A-Za-z0-9]*'
privatePropertyPattern: '(_)?[A-Za-z][A-Za-z0-9]*'
VariableMaxLength:
active: false
maximumVariableNameLength: 64
@ -217,15 +236,19 @@ naming:
minimumVariableNameLength: 1
VariableNaming:
active: true
variablePattern: '^[a-z][a-z0-9][a-zA-Z0-9]*$'
privateVariablePattern: '^[a-z][a-z0-9][a-zA-Z0-9]*$'
variablePattern: '[a-z][A-Za-z0-9]*'
privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*'
excludeClassPattern: '$^'
ignoreOverridden: true
performance:
active: true
ArrayPrimitive:
active: false
ForEachOnRange:
active: true
SpreadOperator:
active: true
active: false
UnnecessaryTemporaryInstantiation:
active: true
@ -270,15 +293,20 @@ style:
active: false
conversionFunctionPrefix: 'to'
EqualsNullCall:
active: false
active: true
ExplicitItLambdaParameter:
active: true
ExpressionBodySyntax:
active: true
includeLineWrapping: false
ForbiddenComment:
active: true
values: 'STOPSHIP:'
ForbiddenImport:
active: false
imports: ''
ForbiddenVoid:
active: false
FunctionOnlyReturningConstant:
active: false
ignoreOverridableFunction: true
@ -289,36 +317,43 @@ style:
MagicNumber:
active: false
ignoreNumbers: '-1,0,1,2'
ignoreHashCodeFunction: false
ignorePropertyDeclaration: true
ignoreHashCodeFunction: true
ignorePropertyDeclaration: false
ignoreConstantDeclaration: true
ignoreCompanionObjectPropertyDeclaration: true
ignoreAnnotation: true
ignoreAnnotation: false
ignoreNamedArgument: true
ignoreEnums: true
ignoreEnums: false
MandatoryBracesIfStatements:
active: true
MaxLineLength:
active: true
maxLineLength: 150
excludePackageStatements: false
excludeImportStatements: false
excludePackageStatements: true
excludeImportStatements: true
excludeCommentStatements: false
MayBeConst:
active: true
ModifierOrder:
active: true
NestedClassesVisibility:
active: false
NewLineAtEndOfFile:
active: false
OptionalAbstractKeyword:
active: true
OptionalReturnKeyword:
NoTabs:
active: true
OptionalAbstractKeyword:
active: true
OptionalUnit:
active: true
OptionalWhenBraces:
active: false
active: true
PreferToOverPairSyntax:
active: true
ProtectedMemberInFinalClass:
active: false
active: true
RedundantVisibilityModifierRule:
active: false
active: true
ReturnCount:
active: true
max: 3
@ -332,23 +367,35 @@ style:
ThrowsCount:
active: true
max: 3
TrailingWhitespace:
active: true
UnnecessaryAbstractClass:
active: false
excludeAnnotatedClasses: "dagger.Module"
UnnecessaryApply:
active: true
UnnecessaryInheritance:
active: false
active: true
UnnecessaryLet:
active: true
UnnecessaryParentheses:
active: false
active: true
UntilInsteadOfRangeTo:
active: true
UnusedImports:
active: true
UnusedPrivateClass:
active: true
UnusedPrivateMember:
active: true
allowedNames: "(_|ignored|expected|serialVersionUID)"
UseDataClass:
active: true
excludeAnnotatedClasses: ""
UtilityClassWithPublicConstructor:
active: false
VarCouldBeVal:
active: true
WildcardImport:
active: true
excludeImports: 'java.util.*,kotlinx.android.synthetic.*'
MandatoryBracesIfStatements:
active: true