html_report

package
v0.42.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 20 Imported by: 1 module, 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

Copyright 2022 Dave Shanley / Quobix SPDX-License-Identifier: MIT

Index

Constants

View Source
const MaxViolations = 100

MaxViolations the maximum number of violations the report will render per broken rule. TODO: make this configurable

Variables

This section is empty.

Functions

func AssetsAvailable added in v0.25.4

func AssetsAvailable() bool

AssetsAvailable indicates whether the interactive HTML report UI bundles were compiled into this build. Official release builds enable this using the `html_report_ui` build tag.

func WriteExport added in v0.36.0

func WriteExport(w io.Writer, rows []ExportRow) error

WriteExport writes all findings as a standalone HTML report without UI assets or scripts.

Types

type ExportRow added in v0.36.0

type ExportRow struct {
	Source, Rule, Message, Severity, Path string
	Line, Column                          int
}

ExportRow contains a complete finding for the standalone HTML export. Line and Column are one-based. All strings are escaped by html/template.

type HTMLReport

type HTMLReport interface {
	GenerateReport(testMode bool, version string) []byte
}

func NewHTMLReport

func NewHTMLReport(
	index *index.SpecIndex,
	info *datamodel.SpecInfo,
	results *model.RuleResultSet,
	stats *reports.ReportStatistics,
	disableTimestamp bool) HTMLReport

type ReportData

type ReportData struct {
	BundledJS        string                    `json:"bundledJS"`
	ShoelaceJS       string                    `json:"shoelaceJS"`
	ReportCSS        string                    `json:"reportCSS"`
	Statistics       *reports.ReportStatistics `json:"reportStatistics"`
	TestMode         bool                      `json:"test"`
	RuleCategories   []*model.RuleCategory     `json:"ruleCategories"`
	RuleResults      *model.RuleResultSet      `json:"ruleResults"`
	MaxViolations    int                       `json:"maxViolations"`
	Generated        time.Time                 `json:"generated"`
	Version          string                    `json:"version"`
	DisableTimestamp bool                      `json:"-"`
	SpecString       []string                  `json:"-"`
}

Jump to

Keyboard shortcuts

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