codequality

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package codequality renders engine reports as GitLab Code Quality reports (artifacts:reports:codequality), which GitLab shows in the merge request widget and the pipeline's Code Quality tab. Shared by the CLI's --output gitlab-codequality and the server's /api/v1/gate?format=gitlab-codequality endpoint.

Index

Constants

View Source
const (
	// VirtualPrefix starts the location.path of an entry that has no file:
	// upgradescope/<finding key> or upgradescope/not-assessed/<capability>.
	// GitLab requires a path, and an entry it cannot place on a file still
	// shows in the merge request widget; its file link goes nowhere.
	VirtualPrefix = "upgradescope/"
)

Variables

This section is empty.

Functions

func Write

func Write(w io.Writer, r engine.Report) error

Write renders the report as a GitLab Code Quality report: a JSON array with one entry per (finding, object located in a file) — check_name the finding's key, location the object's file and line as in SARIF, or line 1 when only the file is known (SARIF leaves such an object unlocated; GitLab can still link the file) — and, since GitLab requires a location, one entry anchored to the virtual path upgradescope/<key>, line 1, per finding with no located object (live-cluster findings, add-ons, skew, a /gate stream posted without ?path=) and per located finding with affected objects that have no file or are not recorded. Severity: blocker → critical, warning → minor, info → info. A required assessment gap, which makes the verdict unknown, is a critical entry (check not-assessed/<capability>), a partial one is info, and an optional check that did not run is left out, as in SARIF. Suppressed findings are left out: GitLab has no dismissed state, and every other output lists them. Baseline-unchanged findings stay: GitLab compares the merge request's report with the target branch's itself.

Fingerprints hash the key and the object's file, namespace and name (the key and virtual path for an unlocated entry), never its line or counts, so an entry survives edits that move it; objects sharing an identity are numbered after the first. GitLab keys entries by fingerprint, so every one is unique. An empty report is [], not null.

Types

This section is empty.

Directories

Path Synopsis
Package codequalitytest checks GitLab Code Quality reports against what GitLab accepts, for every package that emits one (the CLI's --output gitlab-codequality and the server's /api/v1/gate?format=gitlab-codequality).
Package codequalitytest checks GitLab Code Quality reports against what GitLab accepts, for every package that emits one (the CLI's --output gitlab-codequality and the server's /api/v1/gate?format=gitlab-codequality).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL