ihub-authentication
...About 2 min
ihub-authentication
plugin description
ihub-verification
plugin configuration code static check and test case coverage etc.
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
Information | Description |
---|---|
Plugin ID | pub.ihub.plugin.ihub-authentication |
Plugin Name | Verify Plugin |
Plugin Type | Project [^Project] |
Extension Name | iHubVerification |
Plugin Dependencies | ihub-bom,codenarr,pmd,jacoco,jacoco-report-agregation(main project ) |
plugin functionality
- The project contains
groovy
plugins automatically configuredcodenarrc
plugins, default configurationSeeand can be configured by config$rootDir/conf/codenarc/codenarc.groovy
overwrite the default configuration,examples - 项目包含
java
插件时会自动配置pmd
插件,组件使用com.alibaba.p3c:p3c-pmd
,可通过$rootDir/conf/pmd/ruleset.xml
配置检查规则,默认规则如下:
RuleSets = [
'rulesets/java/ali-comment.xml',
'rulesets/java/ali-concilient. ml',
'rulesets/java/ali-constant.xml',
'rulesets/java/ali-exception.xml',
'rulesets/java/ali-flowcontrol. ml',
'rulesets/java/ali-naming.xml',
'rulesets/java/ali-oop.xml',
'rulesets/java/ali-orm. ml',
'rulesets/java/ali-other.xml',
'rulesets/java/ali-set.xml',
'rulesets/vm/ali-other.xml',
]
jacoco
Plugins are used to check code test coverage, primarily at:bundle branch coverage
,bundle command covering
andpackage command covering
, The result is that the main project will addjacoco-report-agregation
plugins for multi-project aggregating test reports, printing reportSee ::
Extended Properties
pmd
starts withPMD-static check
,codenarrc
starts withCodenarc static check
,jacoco
starts withJacoco coverage
Extension | Description | Default | Ext[^Ext] | Prj[^Prj] | Sys[^Sys] | Env[^Env] |
---|---|---|---|---|---|---|
pmConsoleOutput | Whether or not the console print PMD information | false | ✔ | ✔ | ❌ | ❌ |
pmdIgnoreFailures | PMD check failed to ignore | false | ✔ | ✔ | ✔ | ❌ |
pmdversion | PMD Version | 6.55.0 | ✔ | ✔ | ❌ | ❌ |
codenarcIgnoreFailures | Codenarc check if failed to ignore | false | ✔ | ✔ | ✔ | ❌ |
codenarcVersion | Codenarc Version | 3.2.0 | ✔ | ✔ | ❌ | ❌ |
jacoco Version | Jacoco Version | 0.8.8 | ✔ | ✔ | ❌ | ❌ |
jacocoBranchCoverage RuleEnabled | Enable Bundle branch overwrite check | true | ✔ | ✔ | ✔ | ❌ |
jacocoBranchCoveredRatio | bundle branch coverage | 0.9 | ✔ | ✔ | ✔ | ❌ |
jacocoInstructionCoverageRuleEnabled | Enable Bundle command overwrite check | true | ✔ | ✔ | ✔ | ❌ |
jacocoInstructionExclusion | bundle command overwrite exclusion directory | **/app **/config | ✔ | ✔ | ❌ | ❌ |
jacoco Instruction CoveredRatio | bundle command coverage | 0.9 | ✔ | ✔ | ✔ | ❌ |
jacocoPackageCoverage RuleEnabled | Enable package command overwrite check | true | ✔ | ✔ | ✔ | ❌ |
jacocoPackageExclusion | package command overwrite exclusion directory | *.app *.config | ✔ | ✔ | ❌ | ❌ |
jacocoPackageCoveredRatio | package command coverage | 0.9 | ✔ | ✔ | ✔ | ❌ |
jacocoReportExclusion | Coverage Report Exclude Directory | **/Application.class **/app/*.class **/config/*.class | ✔ | ✔ | ❌ | ❌ |
Plugin Installation
Kotlin
plugins {
id("pub.ihub.plugin.ihub-verification")
}
Groovy
plugins {
id 'pub.ihub.plugin.ihub-verification'
}
Configuration Example
PMD Static Check Example
Kotlin
iHubVerification {
pmdConsoleOutput.set(true)
}
Groovy
iHubVerification maximum
pmdConsoleOutput = true
}
Example Codenacs static check
Kotlin
iHubVerification maximum
codenarcIgnoreFailures.set(true)
}
Groovy
iHubVerification LO
codenicarcIgnore Failures = true
}
Jacoco Test Overwrite Example
Kotlin
iHubVerification $
jacocoBranchCoverageRuleEnabled.set(true)
jacocoInstructionCoverageRuleEnabled.set(true)
jacocoPackageEnabled.set(true)
}
Groovy
iHubVerification {
jacocoBranchCoverageRuleEnabed = true
jacocoInstruction CoverageRuleEnabed = true
jacocoPackageRuleEnabed =
}
Test Report
Test case reports will be generated and the console will print test cover.
- Sample coverage of individual project tests
- Project Summary Test Coverage Example