[3.4.0-map-sdk] rules
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
apply plugin: 'io.gitlab.arturbosch.detekt'
|
||||
plugins {
|
||||
id("io.gitlab.arturbosch.detekt") version "1.21.0"
|
||||
}
|
||||
|
||||
def pmdConfigPath = rootProject.file("codequality").path
|
||||
|
||||
@@ -6,9 +8,9 @@ detekt{
|
||||
//将配置文件应用于detekt的默认配置文件之上
|
||||
buildUponDefaultConfig = true
|
||||
source = files(
|
||||
"src/main/kotlin",
|
||||
"src/jinlvvan/kotlin",
|
||||
"src/driverm1/kotlin"
|
||||
"src/main/java",
|
||||
"src/jinlvvan/java",
|
||||
"src/driverm1/java"
|
||||
)
|
||||
//规则集
|
||||
config.setFrom("${pmdConfigPath}/detekt.yml")
|
||||
|
||||
@@ -487,36 +487,37 @@ potential-bugs:
|
||||
MissingPackageDeclaration: #当缺少包声明时报告
|
||||
active: false
|
||||
excludes: ['**/*.kts']
|
||||
NullCheckOnMutableProperty: #规则已弃用,因为编译器默认执行此检查,当主题是枚举或密封类时,以及当表达式用作语句时,启用此规则可标记未检查是否覆盖所有事例的表达式
|
||||
NullCheckOnMutableProperty: #报告对可变属性的null检查,因为这些属性的值可以在执行if语句后更改,从而使null检查无效
|
||||
active: false
|
||||
NullableToStringCall: #报告对可变属性的null检查,因为这些属性的值可以在执行if语句后更改,从而使null检查无效
|
||||
NullableToStringCall: #使用可能返回字符串“null”的可为null的接收器报告toString()调用
|
||||
active: false
|
||||
PropertyUsedBeforeDeclaration: #
|
||||
PropertyUsedBeforeDeclaration: #报告在声明之前使用的属性
|
||||
active: false
|
||||
UnconditionalJumpStatementInLoop:
|
||||
UnconditionalJumpStatementInLoop: #报告包含跳转语句的循环,这些语句在任何条件下都会跳转
|
||||
active: false
|
||||
UnnecessaryNotNullCheck:
|
||||
UnnecessaryNotNullCheck: #使用requireNotNull或checkNotNull报告用户可以删除的不必要的非null检查。
|
||||
active: false
|
||||
UnnecessaryNotNullOperator:
|
||||
UnnecessaryNotNullOperator: #报告用户可以删除的不必要的非null运算符用法(!!)
|
||||
active: true
|
||||
UnnecessarySafeCall:
|
||||
UnnecessarySafeCall: #报告用户可以删除的不必要的非null运算符用法(?)
|
||||
active: true
|
||||
UnreachableCatchBlock:
|
||||
UnreachableCatchBlock: #报告无法访问的捕获块。如果在上面的块中已经捕获到异常,则捕获块可能无法访问(Exception or Throwable)catch顺序
|
||||
active: true
|
||||
UnreachableCode:
|
||||
UnreachableCode: #报告无法访问的代码。代码可能无法访问,因为它位于return、throw、continue或break表达式后面
|
||||
active: true
|
||||
UnsafeCallOnNullableType:
|
||||
UnsafeCallOnNullableType: #报告对可为null的类型的不安全调用
|
||||
active: true
|
||||
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/androidUnitTest/**', '**/androidInstrumentedTest/**', '**/jsTest/**', '**/iosTest/**']
|
||||
UnsafeCast:
|
||||
UnsafeCast: #报告不安全的强制转换
|
||||
active: true
|
||||
UnusedUnaryOperator:
|
||||
UnusedUnaryOperator: #检测未使用的一元运算符
|
||||
active: true
|
||||
UselessPostfixExpression:
|
||||
UselessPostfixExpression: #报告未使用因而不必要的后缀表达式(++,--)
|
||||
active: true
|
||||
WrongEqualsTypeParameter:
|
||||
WrongEqualsTypeParameter: #报告接受错误类型参数的equals()方法
|
||||
active: true
|
||||
|
||||
#{link https://detekt.dev/docs/rules/style#explicititlambdaparameter}
|
||||
style:
|
||||
active: true
|
||||
AbstractClassCanBeConcreteClass:
|
||||
@@ -550,7 +551,7 @@ style:
|
||||
DataClassShouldBeImmutable:
|
||||
active: false
|
||||
DestructuringDeclarationWithTooManyEntries:
|
||||
active: true
|
||||
active: false
|
||||
maxDestructuringEntries: 3
|
||||
DoubleNegativeLambda:
|
||||
active: false
|
||||
@@ -591,7 +592,7 @@ style:
|
||||
- reason: 'Kotlin does not support @Inherited annotation, see https://youtrack.jetbrains.com/issue/KT-22265'
|
||||
value: 'java.lang.annotation.Inherited'
|
||||
ForbiddenComment:
|
||||
active: true
|
||||
active: false
|
||||
comments:
|
||||
- reason: 'Forbidden FIXME todo marker in comment, please fix the problem.'
|
||||
value: 'FIXME:'
|
||||
@@ -668,7 +669,7 @@ style:
|
||||
trimmingMethods:
|
||||
- 'trimIndent'
|
||||
- 'trimMargin'
|
||||
NestedClassesVisibility:
|
||||
NestedClassesVisibility: #嵌套类从父类继承其可见性,通常用于实现嵌套在其中的类的本地功能。这些嵌套类的可见性不能高于其父类
|
||||
active: true
|
||||
NewLineAtEndOfFile:
|
||||
active: true
|
||||
@@ -676,7 +677,7 @@ style:
|
||||
active: false
|
||||
NullableBooleanCheck:
|
||||
active: false
|
||||
ObjectLiteralToLambda:
|
||||
ObjectLiteralToLambda: #除了实现单个方法之外什么都不做的匿名对象可以用作lambda。
|
||||
active: true
|
||||
OptionalAbstractKeyword:
|
||||
active: true
|
||||
@@ -694,7 +695,7 @@ style:
|
||||
active: true
|
||||
RedundantVisibilityModifierRule:
|
||||
active: false
|
||||
ReturnCount:
|
||||
ReturnCount: #在一个函数中有许多出口点可能会造成混乱,并影响代码的可读性。
|
||||
active: true
|
||||
max: 2
|
||||
excludedFunctions:
|
||||
@@ -712,7 +713,7 @@ style:
|
||||
active: false
|
||||
maxEscapedCharacterCount: 2
|
||||
ignoredCharacters: []
|
||||
ThrowsCount:
|
||||
ThrowsCount: #限制函数中抛出语句的数量,函数应该有明确的throw语句
|
||||
active: true
|
||||
max: 2
|
||||
excludeGuardClauses: false
|
||||
@@ -737,7 +738,7 @@ style:
|
||||
active: false
|
||||
UnnecessaryFilter:
|
||||
active: true
|
||||
UnnecessaryInheritance:
|
||||
UnnecessaryInheritance: #此规则报告不必要的超类型
|
||||
active: true
|
||||
UnnecessaryInnerClass:
|
||||
active: false
|
||||
|
||||
Reference in New Issue
Block a user