Skip to main content

ihub-authentication

Henry...About 2 min

ihub-authentication

plugin description

ihub-verificationplugin configuration code static check and test case coverage etc.

:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::
:::

InformationDescription
Plugin IDpub.ihub.plugin.ihub-authentication
Plugin NameVerify Plugin
Plugin TypeProject[^Project]
Extension NameiHubVerification
Plugin Dependenciesihub-bom,codenarropen in new window,pmdopen in new window,jacocoopen in new window,jacoco-report-agregationopen in new window(main project)

plugin functionality

  • The project containsgroovyplugins automatically configuredcodenarrc plugins, default configurationSeeopen in new windowand can be configured by config$rootDir/conf/codenarc/codenarc.groovyoverwrite the default configuration,examplesopen in new window
  • 项目包含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',
]
  • jacocoPlugins are used to check code test coverage, primarily at:bundle branch coverage,bundle command coveringandpackage command covering , The result is that the main project will addjacoco-report-agregationplugins for multi-project aggregating test reports, printing reportSee ::

Extended Properties

pmdstarts withPMD-static check,codenarrcstarts withCodenarc static check,jacocostarts withJacoco coverage

ExtensionDescriptionDefaultExt[^Ext]Prj[^Prj]Sys[^Sys]Env[^Env]
pmConsoleOutputWhether or not the console print PMD informationfalse
pmdIgnoreFailuresPMD check failed to ignorefalse
pmdversionPMD Version6.55.0
codenarcIgnoreFailuresCodenarc check if failed to ignorefalse
codenarcVersionCodenarc Version3.2.0
jacoco VersionJacoco Version0.8.8
jacocoBranchCoverage RuleEnabledEnable Bundle branch overwrite checktrue
jacocoBranchCoveredRatiobundle branch coverage0.9
jacocoInstructionCoverageRuleEnabledEnable Bundle command overwrite checktrue
jacocoInstructionExclusionbundle command overwrite exclusion directory**/app
**/config
jacoco Instruction CoveredRatiobundle command coverage0.9
jacocoPackageCoverage RuleEnabledEnable package command overwrite checktrue
jacocoPackageExclusionpackage command overwrite exclusion directory*.app
*.config
jacocoPackageCoveredRatiopackage command coverage0.9
jacocoReportExclusionCoverage Report Exclude Directory**/Application.class
**/app/*.class
**/config/*.class

Plugin Installation

Kotlin
plugins {
    id("pub.ihub.plugin.ihub-verification")
}

Configuration Example

PMD Static Check Example

Kotlin
iHubVerification {
    pmdConsoleOutput.set(true)
}

Example Codenacs static check

Kotlin
iHubVerification maximum
    codenarcIgnoreFailures.set(true)
}

Jacoco Test Overwrite Example

Kotlin
iHubVerification $
    jacocoBranchCoverageRuleEnabled.set(true)
    jacocoInstructionCoverageRuleEnabled.set(true)
    jacocoPackageEnabled.set(true)
}

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