Report a bug
If you spot a problem with this page, click here to create a GitHub issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

dmd.sarif

Provides SARIF (Static Analysis Results Interchange Format) reporting functionality.
Authors:

Source sarif.d

Coverage Code Coverage

Description

  • This module generates SARIF reports for DMD errors, warnings, and messages.
  • It supports JSON serialization of SARIF tools, results, and invocations.
  • The generated reports are compatible with SARIF 2.1.0 schema.

class ErrorSinkSarif: dmd.errors.ErrorSinkCompiler;
Error sink that produces a SARIF 2.1.0 report.
Inherits all gating logic (gag handling, error limit, warning/deprecation modes) from ErrorSinkCompiler. The only customisation is the output format: emit appends a results[] entry to buf, and plugSink writes the complete SARIF document to stdout at the end of compilation.
OutBuffer buf;
Accumulates the results array entries (without surrounding [ ]).