[#545] Detekt 1.21.0

This commit is contained in:
Carter Jernigan 2022-07-19 07:10:34 -04:00 committed by GitHub
parent 87dbf3b60a
commit 18a81eaef4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 66 additions and 52 deletions

View File

@ -25,6 +25,7 @@ tasks {
exclude("**/commonTest/**") exclude("**/commonTest/**")
exclude("**/jvmTest/**") exclude("**/jvmTest/**")
exclude("**/androidTest/**") exclude("**/androidTest/**")
// To regenerate the config, run the task `detektGenerateConfig`
config.setFrom(files("${rootProject.projectDir}/tools/detekt.yml")) config.setFrom(files("${rootProject.projectDir}/tools/detekt.yml"))
buildUponDefaultConfig = true buildUponDefaultConfig = true
} }

View File

@ -85,10 +85,10 @@ commons-logging:commons-logging:1.2=classpath
de.undercouch:gradle-download-task:4.1.1=classpath de.undercouch:gradle-download-task:4.1.1=classpath
io.github.detekt.sarif4k:sarif4k:0.0.1=classpath io.github.detekt.sarif4k:sarif4k:0.0.1=classpath
io.github.x-stream:mxparser:1.2.1=classpath io.github.x-stream:mxparser:1.2.1=classpath
io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.20.0=classpath io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.21.0=classpath
io.gitlab.arturbosch.detekt:detekt-utils:1.20.0=classpath
io.gitlab.arturbosch.detekt:io.gitlab.arturbosch.detekt.gradle.plugin:1.19.0=classpathCopy io.gitlab.arturbosch.detekt:io.gitlab.arturbosch.detekt.gradle.plugin:1.19.0=classpathCopy
io.gitlab.arturbosch.detekt:io.gitlab.arturbosch.detekt.gradle.plugin:1.20.0=classpath,classpathCopy2 io.gitlab.arturbosch.detekt:io.gitlab.arturbosch.detekt.gradle.plugin:1.20.0=classpathCopy2
io.gitlab.arturbosch.detekt:io.gitlab.arturbosch.detekt.gradle.plugin:1.21.0=classpath
io.grpc:grpc-api:1.21.1=classpath io.grpc:grpc-api:1.21.1=classpath
io.grpc:grpc-context:1.21.1=classpath io.grpc:grpc-context:1.21.1=classpath
io.grpc:grpc-core:1.21.1=classpath io.grpc:grpc-core:1.21.1=classpath

View File

@ -91,7 +91,7 @@ ANDROID_COMPILE_SDK_VERSION=33
ANDROID_NDK_VERSION=23.0.7599858 ANDROID_NDK_VERSION=23.0.7599858
ANDROID_GRADLE_PLUGIN_VERSION=7.2.1 ANDROID_GRADLE_PLUGIN_VERSION=7.2.1
DETEKT_VERSION=1.20.0 DETEKT_VERSION=1.21.0
EMULATOR_WTF_GRADLE_PLUGIN_VERSION=0.0.10 EMULATOR_WTF_GRADLE_PLUGIN_VERSION=0.0.10
FLANK_VERSION=21.09.0 FLANK_VERSION=21.09.0
FULLADLE_VERSION=0.17.4 FULLADLE_VERSION=0.17.4

View File

@ -35,7 +35,7 @@ object ProcessNameCompat {
val foundProcessName = searchForProcessName(context) val foundProcessName = searchForProcessName(context)
if (null == foundProcessName) { if (null == foundProcessName) {
// This should be exceedingly rare // This should be exceedingly rare
throw IllegalStateException("Unable to determine process name") error("Unable to determine process name")
} else { } else {
processName = foundProcessName processName = foundProcessName
return foundProcessName return foundProcessName

View File

@ -46,6 +46,7 @@ output-reports:
# - 'TxtOutputReport' # - 'TxtOutputReport'
# - 'XmlOutputReport' # - 'XmlOutputReport'
# - 'HtmlOutputReport' # - 'HtmlOutputReport'
# - 'MdOutputReport'
comments: comments:
active: true active: true
@ -62,6 +63,9 @@ comments:
EndOfSentenceFormat: EndOfSentenceFormat:
active: false active: false
endOfSentenceFormat: '([.?!][ \t\n\r\f<])|([.?!:]$)' endOfSentenceFormat: '([.?!][ \t\n\r\f<])|([.?!:]$)'
KDocReferencesNonPublicProperty:
active: false
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
OutdatedDocumentation: OutdatedDocumentation:
active: false active: false
matchTypeParameters: true matchTypeParameters: true
@ -133,6 +137,15 @@ complexity:
NestedBlockDepth: NestedBlockDepth:
active: true active: true
threshold: 4 threshold: 4
NestedScopeFunctions:
active: false
threshold: 1
functions:
- 'kotlin.apply'
- 'kotlin.run'
- 'kotlin.with'
- 'kotlin.let'
- 'kotlin.also'
ReplaceSafeCallChainWithRun: ReplaceSafeCallChainWithRun:
active: false active: false
StringLiteralDuplication: StringLiteralDuplication:
@ -159,15 +172,15 @@ coroutines:
GlobalCoroutineUsage: GlobalCoroutineUsage:
active: false active: false
InjectDispatcher: InjectDispatcher:
active: false active: true
dispatcherNames: dispatcherNames:
- 'IO' - 'IO'
- 'Default' - 'Default'
- 'Unconfined' - 'Unconfined'
RedundantSuspendModifier: RedundantSuspendModifier:
active: false active: true
SleepInsteadOfDelay: SleepInsteadOfDelay:
active: false active: true
SuspendFunWithCoroutineScopeReceiver: SuspendFunWithCoroutineScopeReceiver:
active: false active: false
SuspendFunWithFlowReturnType: SuspendFunWithFlowReturnType:
@ -218,7 +231,7 @@ exceptions:
- 'hashCode' - 'hashCode'
- 'toString' - 'toString'
InstanceOfCheckForException: InstanceOfCheckForException:
active: false active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
NotImplementedDeclaration: NotImplementedDeclaration:
active: false active: false
@ -283,58 +296,48 @@ naming:
active: true active: true
BooleanPropertyNaming: BooleanPropertyNaming:
active: false active: false
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
allowedPattern: '^(is|has|are)' allowedPattern: '^(is|has|are)'
ignoreOverridden: true ignoreOverridden: true
ClassNaming: ClassNaming:
active: true active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
classPattern: '[A-Z][a-zA-Z0-9]*' classPattern: '[A-Z][a-zA-Z0-9]*'
ConstructorParameterNaming: ConstructorParameterNaming:
active: true active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
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/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
enumEntryPattern: '[A-Z][_a-zA-Z0-9]*' enumEntryPattern: '[A-Z][_a-zA-Z0-9]*'
ForbiddenClassName: ForbiddenClassName:
active: false active: false
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
forbiddenName: [] forbiddenName: []
FunctionMaxLength: FunctionMaxLength:
active: false active: false
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
maximumFunctionNameLength: 30 maximumFunctionNameLength: 30
FunctionMinLength: FunctionMinLength:
active: false active: false
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
minimumFunctionNameLength: 3 minimumFunctionNameLength: 3
FunctionNaming: FunctionNaming:
active: true active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
functionPattern: '([a-z][a-zA-Z0-9]*)|(`.*`)' functionPattern: '[a-z][a-zA-Z0-9]*'
excludeClassPattern: '$^' excludeClassPattern: '$^'
ignoreOverridden: true ignoreOverridden: true
ignoreAnnotated: ignoreAnnotated:
- 'Composable' - 'Composable'
FunctionParameterNaming: FunctionParameterNaming:
active: true active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
parameterPattern: '[a-z][A-Za-z0-9]*' parameterPattern: '[a-z][A-Za-z0-9]*'
excludeClassPattern: '$^' excludeClassPattern: '$^'
ignoreOverridden: true ignoreOverridden: true
InvalidPackageDeclaration: InvalidPackageDeclaration:
active: false active: true
excludes: ['**/*.kts']
rootPackage: '' rootPackage: ''
requireRootInDeclaration: false requireRootInDeclaration: false
LambdaParameterNaming: LambdaParameterNaming:
active: false active: false
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
parameterPattern: '[a-z][A-Za-z0-9]*|_' parameterPattern: '[a-z][A-Za-z0-9]*|_'
MatchingDeclarationName: MatchingDeclarationName:
active: true active: true
@ -343,37 +346,30 @@ naming:
active: true active: true
ignoreOverridden: true ignoreOverridden: true
NoNameShadowing: NoNameShadowing:
active: false active: true
NonBooleanPropertyPrefixedWithIs: NonBooleanPropertyPrefixedWithIs:
active: false active: false
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
ObjectPropertyNaming: ObjectPropertyNaming:
active: true active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
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/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
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/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
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: false active: false
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
maximumVariableNameLength: 64 maximumVariableNameLength: 64
VariableMinLength: VariableMinLength:
active: false active: false
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
minimumVariableNameLength: 1 minimumVariableNameLength: 1
VariableNaming: VariableNaming:
active: true active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
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: '$^'
@ -383,6 +379,9 @@ performance:
active: true active: true
ArrayPrimitive: ArrayPrimitive:
active: true active: true
CouldBeSequence:
active: false
threshold: 3
ForEachOnRange: ForEachOnRange:
active: true active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
@ -395,7 +394,7 @@ performance:
potential-bugs: potential-bugs:
active: true active: true
AvoidReferentialEquality: AvoidReferentialEquality:
active: false active: true
forbiddenTypePatterns: forbiddenTypePatterns:
- 'kotlin.String' - 'kotlin.String'
CastToNullableType: CastToNullableType:
@ -405,7 +404,7 @@ potential-bugs:
DontDowncastCollectionTypes: DontDowncastCollectionTypes:
active: false active: false
DoubleMutabilityForCollection: DoubleMutabilityForCollection:
active: false active: true
mutableTypes: mutableTypes:
- 'kotlin.collections.MutableList' - 'kotlin.collections.MutableList'
- 'kotlin.collections.MutableMap' - 'kotlin.collections.MutableMap'
@ -428,9 +427,9 @@ potential-bugs:
ExplicitGarbageCollectionCall: ExplicitGarbageCollectionCall:
active: true active: true
HasPlatformType: HasPlatformType:
active: false active: true
IgnoredReturnValue: IgnoredReturnValue:
active: false active: true
restrictToAnnotatedMethods: true restrictToAnnotatedMethods: true
returnValueAnnotations: returnValueAnnotations:
- '*.CheckResult' - '*.CheckResult'
@ -454,7 +453,7 @@ potential-bugs:
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
ignoreOnClassesPattern: '' ignoreOnClassesPattern: ''
MapGetWithNotNullAssertionOperator: MapGetWithNotNullAssertionOperator:
active: false active: true
MissingPackageDeclaration: MissingPackageDeclaration:
active: false active: false
excludes: ['**/*.kts'] excludes: ['**/*.kts']
@ -474,7 +473,7 @@ potential-bugs:
UnnecessarySafeCall: UnnecessarySafeCall:
active: true active: true
UnreachableCatchBlock: UnreachableCatchBlock:
active: false active: true
UnreachableCode: UnreachableCode:
active: true active: true
UnsafeCallOnNullableType: UnsafeCallOnNullableType:
@ -483,9 +482,9 @@ potential-bugs:
UnsafeCast: UnsafeCast:
active: true active: true
UnusedUnaryOperator: UnusedUnaryOperator:
active: false active: true
UselessPostfixExpression: UselessPostfixExpression:
active: false active: true
WrongEqualsTypeParameter: WrongEqualsTypeParameter:
active: true active: true
@ -493,6 +492,9 @@ style:
active: true active: true
CanBeNonNullable: CanBeNonNullable:
active: false active: false
CascadingCallWrapping:
active: false
includeElvis: true
ClassOrdering: ClassOrdering:
active: false active: false
CollapsibleIfStatements: CollapsibleIfStatements:
@ -503,7 +505,7 @@ style:
DataClassShouldBeImmutable: DataClassShouldBeImmutable:
active: false active: false
DestructuringDeclarationWithTooManyEntries: DestructuringDeclarationWithTooManyEntries:
active: false active: true
maxDestructuringEntries: 3 maxDestructuringEntries: 3
EqualsNullCall: EqualsNullCall:
active: true active: true
@ -512,7 +514,7 @@ style:
ExplicitCollectionElementAccessMethod: ExplicitCollectionElementAccessMethod:
active: false active: false
ExplicitItLambdaParameter: ExplicitItLambdaParameter:
active: false active: true
ExpressionBodySyntax: ExpressionBodySyntax:
active: false active: false
includeLineWrapping: false includeLineWrapping: false
@ -539,8 +541,11 @@ style:
ignorePackages: ignorePackages:
- '*.internal' - '*.internal'
- '*.internal.*' - '*.internal.*'
ForbiddenVoid: ForbiddenSuppress:
active: false active: false
rules: []
ForbiddenVoid:
active: true
ignoreOverridden: false ignoreOverridden: false
ignoreUsageInGenerics: false ignoreUsageInGenerics: false
FunctionOnlyReturningConstant: FunctionOnlyReturningConstant:
@ -559,7 +564,7 @@ style:
maxJumpCount: 1 maxJumpCount: 1
MagicNumber: MagicNumber:
active: true active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**', '**/*.kts']
ignoreNumbers: ignoreNumbers:
- '-1' - '-1'
- '0' - '0'
@ -579,6 +584,9 @@ style:
active: false active: false
MandatoryBracesLoops: MandatoryBracesLoops:
active: false active: false
MaxChainedCallsOnSameLine:
active: false
maxChainedCalls: 5
MaxLineLength: MaxLineLength:
active: true active: true
maxLineLength: 120 maxLineLength: 120
@ -597,8 +605,10 @@ style:
active: false active: false
NoTabs: NoTabs:
active: false active: false
ObjectLiteralToLambda: NullableBooleanCheck:
active: false active: false
ObjectLiteralToLambda:
active: true
OptionalAbstractKeyword: OptionalAbstractKeyword:
active: true active: true
OptionalUnit: OptionalUnit:
@ -612,7 +622,7 @@ style:
RedundantExplicitType: RedundantExplicitType:
active: false active: false
RedundantHigherOrderMapUsage: RedundantHigherOrderMapUsage:
active: false active: true
RedundantVisibilityModifierRule: RedundantVisibilityModifierRule:
active: false active: false
ReturnCount: ReturnCount:
@ -644,8 +654,10 @@ style:
active: false active: false
UnnecessaryApply: UnnecessaryApply:
active: true active: true
UnnecessaryFilter: UnnecessaryBackticks:
active: false active: false
UnnecessaryFilter:
active: true
UnnecessaryInheritance: UnnecessaryInheritance:
active: true active: true
UnnecessaryInnerClass: UnnecessaryInnerClass:
@ -664,13 +676,13 @@ style:
active: true active: true
allowedNames: '(_|ignored|expected|serialVersionUID)' allowedNames: '(_|ignored|expected|serialVersionUID)'
UseAnyOrNoneInsteadOfFind: UseAnyOrNoneInsteadOfFind:
active: false active: true
UseArrayLiteralsInAnnotations: UseArrayLiteralsInAnnotations:
active: false active: true
UseCheckNotNull: UseCheckNotNull:
active: false active: true
UseCheckOrError: UseCheckOrError:
active: false active: true
UseDataClass: UseDataClass:
active: false active: false
allowVars: false allowVars: false
@ -681,19 +693,20 @@ style:
UseIfInsteadOfWhen: UseIfInsteadOfWhen:
active: false active: false
UseIsNullOrEmpty: UseIsNullOrEmpty:
active: false active: true
UseOrEmpty: UseOrEmpty:
active: false active: true
UseRequire: UseRequire:
active: false active: true
UseRequireNotNull: UseRequireNotNull:
active: false active: true
UselessCallOnNotNull: UselessCallOnNotNull:
active: true active: true
UtilityClassWithPublicConstructor: UtilityClassWithPublicConstructor:
active: true active: true
VarCouldBeVal: VarCouldBeVal:
active: true active: true
ignoreLateinitVar: false
WildcardImport: WildcardImport:
active: true active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']