Skip to content

GitLab CI Kotlin DSLopensavvy.gitlab.ciArtifactscodeQuality

codeQuality

fun codeQuality(path: String)

Collects code quality reports to display code quality information in GitLab.

The collected code quality report uploads to GitLab as an artifact with an expiration time of 1 week. GitLab can display the results of one or more reports in:

  • The merge request code quality widget

  • The merge request diff annotations

  • The full report

Example

val code-quality by job {
    script {
        shell("sonar-scanner -Dsonar.qualitygate.wait=true")
    }

    artifacts {
        codeQuality("gl-code-quality-report.json")
    }
}

External resources