[3.4.0-map-sdk]

This commit is contained in:
zhongchao
2023-09-27 17:54:37 +08:00
parent 2bb96c5c5d
commit 4c07709a50
7 changed files with 44 additions and 115 deletions

View File

@@ -1,6 +1,6 @@
apply plugin: 'io.gitlab.arturbosch.detekt'
def pmdConfigPath = rootProject.file("codequality").path
def configPath = rootProject.file("codequality").path
detekt {
toolVersion = "1.15.0"
@@ -10,13 +10,13 @@ detekt {
"src/driverm1/java"
)
//将配置文件应用于detekt的默认配置文件之上
buildUponDefaultConfig = true
buildUponDefaultConfig = false
//规则集
config.setFrom("${pmdConfigPath}/detekt.yml")
config.setFrom("${configPath}/detekt.yml")
//指定基准文件。在detekt的后续运行中所有发现都存储在此文件中
// baseline = file("${pmdConfigPath}/baseline.xml")
// baseline = file("${configPath}/baseline.xml")
ignoreFailures = true
// Android: Don't create tasks for the specified build types (e.g. "release")
// ignoredBuildTypes = ["release"]
// Android: Don't create tasks for the specified build flavor (e.g. "production")
@@ -25,7 +25,7 @@ detekt {
// ignoredVariants = ["productionRelease"]
}
tasks.detekt.jvmTarget = "1.11"
tasks.detekt.jvmTarget = "1.8"
tasks.named("detekt").configure {
reports {
@@ -33,7 +33,21 @@ tasks.named("detekt").configure {
html {
enabled = true
// Path where HTML report will be stored (default: `build/reports/detekt/detekt.html`)
destination = new File(new File("${project.rootProject.buildDir.path}/reports/detekt"), "${project.name}-detekt.xml")
}
xml {
enabled = true
destination = new File(new File("${project.rootProject.buildDir.path}/reports/detekt"), "${project.name}-detekt.html")
}
txt {
enabled = false
// destination = new File(new File("${project.rootProject.buildDir.path}/reports/detekt"), "${project.name}-detekt.txt")
}
sarif {
// Enable/Disable SARIF report (default: false)
enabled = true
// Path where SARIF report will be stored (default: `build/reports/detekt/detekt.sarif`)
destination = new File(new File("${project.rootProject.buildDir.path}/reports/detekt"), "${project.name}-detekt.sarif")
}
}
}

View File

@@ -287,12 +287,12 @@ exceptions:
exceptionNames:
- 'ArrayIndexOutOfBoundsException'
- 'Error'
- 'Exception'
# - 'Exception'
- 'IllegalMonitorStateException'
- 'IndexOutOfBoundsException'
- 'NullPointerException'
- 'RuntimeException'
- 'Throwable'
# - 'Throwable'
allowedExceptionNameRegex: '_|(ignore|expected).*'
TooGenericExceptionThrown: #规则报告类型过于通用的抛出异常。对于当前发生的情况,最好抛出特定的异常
active: true
@@ -545,8 +545,8 @@ style:
active: false
DataClassContainsFunctions:
active: false
conversionFunctionPrefix:
- 'to'
# conversionFunctionPrefix:
# - 'to'
# allowOperators: false
DataClassShouldBeImmutable:
active: false
@@ -623,7 +623,7 @@ style:
active: true
ignoreOverridableFunction: true
# ignoreActualFunction: true
excludedFunctions: []
# excludedFunctions: []
LoopWithTooManyJumpStatements:
active: true
maxJumpCount: 1
@@ -695,14 +695,14 @@ style:
active: true
RedundantVisibilityModifierRule:
active: false
ReturnCount: #在一个函数中有许多出口点可能会造成混乱,并影响代码的可读性。
active: true
max: 2
excludedFunctions:
- 'equals'
excludeLabeled: false
excludeReturnFromLambda: true
excludeGuardClauses: false
# ReturnCount: #在一个函数中有许多出口点可能会造成混乱,并影响代码的可读性。
# active: false
# max: 2
# excludedFunctions:
# - 'equals'
# excludeLabeled: false
# excludeReturnFromLambda: false
# excludeGuardClauses: false
SafeCast:
active: true
SerialVersionUIDInSerializableClass:

View File

@@ -4,7 +4,7 @@ def pmdConfigPath = rootProject.file("codequality").path
task pmd(type:Pmd){
//忽略失败如果设置为true检测出bug会停止task
ignoreFailures = false
ignoreFailures = true
consoleOutput = true
//filter路径
ruleSetFiles = files("${pmdConfigPath}/custom-pmd-ruleset.xml") //新增rules