GitlabViolationFormat
in package
implements
ViolationFormat
FinalYes
Writes the violations to a code quality report, which GitLab shows in a merge request and on the lines of its diff.
GitLab reads the report from the file declared as "artifacts:reports:codequality" of the CI job.
Tags
Table of Contents
Interfaces
- ViolationFormat
- A format to report the problems found in the documentation source in, in addition to the log.
Constants
- DEFAULT_FILE : mixed = 'gl-code-quality-report.json'
Properties
- $details : AnnotationDetails
- $issues : array<int, array{description: string, check_name: string, fingerprint: string, severity: string, location: array{path: string, lines: array{begin: int}}}>
- $settingsManager : SettingsManager
Methods
- __construct() : mixed
- finish() : void
- Called once at the end of the run, to write the collected violations wherever this format needs them, like the output of the command, a file or the API of a code review tool.
- report() : void
Constants
DEFAULT_FILE
public
mixed
DEFAULT_FILE
= 'gl-code-quality-report.json'
Properties
$details read-only
private
AnnotationDetails
$details
$issues
private
array<int, array{description: string, check_name: string, fingerprint: string, severity: string, location: array{path: string, lines: array{begin: int}}}>
$issues
= []
$settingsManager read-only
private
SettingsManager
$settingsManager
Methods
__construct()
public
__construct(AnnotationDetails $details, SettingsManager $settingsManager) : mixed
Parameters
- $details : AnnotationDetails
- $settingsManager : SettingsManager
finish()
Called once at the end of the run, to write the collected violations wherever this format needs them, like the output of the command, a file or the API of a code review tool.
public
finish(OutputInterface $output) : void
Parameters
- $output : OutputInterface
report()
public
report(Violation $violation) : void
Parameters
- $violation : Violation