Continuous Integration Servers

VSG supports options to facilitate integration with continuous integration severs such as Bamboo and GitLab. The following command line options are available.

Command Line Option Comment
--junit Generate JUnit report
--quality_report Generate code quality report

JUnit Report

VSG can generate a report of an analysis in JUnit XML format. This report will include the filename along with any errors detected. The rule which was violated, the line number where the violation occured, and the proposed solution are provided.

This report can be used in most CI server applications to create a test report. Refer to the documentation of your CI server application for how to integrate the JUnit report.

An example JUnit XML file is shown below:

<?xml version="1.0" ?>
<testsuite errors="0" hostname="DESKTOP-HV9NHA3" failures="1" timestamp="2022-07-23T04:25:51" tests="1" time="0" name="vhdl-style-guide">
  <properties>
  </properties>
  <testcase name="original.vhd" time="0" classname="failure">
    <failure type="Failure">
      architecture_010: 847 : Add *architecture* keyword.
      concurrent_007: 298 : move code after else to next line.
    </failure>
  </testcase>
  <system-out>
  </system-out>
  <system-err>
  </system-err>
</testsuite>

Code Quality Report

VSG can generate a quality report of an analysis in JSON format. The JSON file generated follows a subset of the Code Climate specification. The following items in the spec are populated.

Code Climate Spec Description
description Includes the rule which failed and the proposed solution
fingerprint An MD5 hash to uniquify the error.
severity The severity of the error. Errors will be reported as critical. Warnings will be reported as minor.
location.path A relative path to the file with code quality issues.
location.lines.begin The line number where the code quality issue occured.

This report can be used in most CI server applications to create a test report. Refer to the documentation of your CI server application for how to integrate the Code Quality Report.

An example of a code quality report is shown below:

[
  {
    "description": "architecture_010 :: Add *architecture* keyword.",
    "fingerprint": "323039ccd1801791163d7a302cfd5b25",
    "severity": "critical",
    "location": {
      "path": "vsg/tests/tool_integration/quality_report/example.vhd",
      "lines": {
        "begin": 8
      }
    }
  }
]