reporting

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

internal/reporting/reporter.go

internal/reporting/sarif_reporter.go

Index

Constants

View Source
const (
	ToolName     = "Scalpel CLI"
	ToolInfoURI  = "https://github.com/xkilldash9x/scalpel-cli"
	SARIFVersion = "2.1.0"
	SARIFSchema  = "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json"
)

Constants for tool identification in the SARIF report.

Variables

This section is empty.

Functions

This section is empty.

Types

type NopWriteCloser

type NopWriteCloser struct {
	io.Writer
}

NopWriteCloser wraps an io.Writer like os.Stdout and provides a no-op Close method. This prevents closing standard streams when the reporter attempts to close its writer.

func (*NopWriteCloser) Close

func (nwc *NopWriteCloser) Close() error

Close is a no-op for standard streams.

type Reporter

type Reporter interface {
	// Write processes a single result envelope.
	Write(result *schemas.ResultEnvelope) error
	// Close finalizes the report and closes any underlying resources (e.g., file handles).
	Close() error
}

Reporter defines the interface for writing scan results to an output. Implementations must be thread-safe.

func New

func New(format, outputPath, toolVersion string) (Reporter, error)

New creates a new reporter based on the specified format and output path. The signature is updated to accept the toolVersion for dependency injection.

type RuleFingerprint

type RuleFingerprint string

type SARIFReporter

type SARIFReporter struct {
	// contains filtered or unexported fields
}

func NewSARIFReporter

func NewSARIFReporter(writer io.WriteCloser, toolVersion string) *SARIFReporter

func (*SARIFReporter) Close

func (r *SARIFReporter) Close() error

func (*SARIFReporter) Write

func (r *SARIFReporter) Write(result *schemas.ResultEnvelope) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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