Help us shape the future of Go! Take the 2026 Go Developer Survey

report

package
v2.950.3 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: AGPL-3.0, MIT Imports: 12 Imported by: 0

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

This section is empty.

Types

type HTMLReport

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

func NewHTMLReport

func NewHTMLReport(data *ValidationReportData) HTMLReport

type ReportData

type ReportData struct {
	BundledJS      template.JS              `json:"bundledJS"`
	HydrateJS      template.JS              `json:"hydrateJS"`
	ShoelaceJS     string                   `json:"shoelaceJS"`
	ReportCSS      template.CSS             `json:"reportCSS"`
	Statistics     *ReportStatistics        `json:"reportStatistics"`
	TestMode       bool                     `json:"test"`
	RuleCategories []*RuleCategory          `json:"ruleCategories"`
	RuleResults    []*validation.Error      `json:"ruleResults"`
	MaxViolations  int                      `json:"maxViolations"`
	Generated      time.Time                `json:"generated"`
	Version        string                   `json:"version"`
	SpecString     []string                 `json:"-"`
	RuleMetadata   map[string]*RuleMetadata `json:"-"` // Map of rule ID to metadata
}

ReportData is the internal struct used by the HTML template

type ReportStatistics

type ReportStatistics struct {
	TotalErrors   int
	TotalWarnings int
	TotalHints    int
}

ReportStatistics contains validation statistics

type RuleCategory

type RuleCategory struct {
	ID          string
	Name        string
	Description string
}

RuleCategory represents a category of validation rules

type RuleMetadata

type RuleMetadata struct {
	Summary     string
	Description string
	HowToFix    string
}

RuleMetadata contains metadata about a rule

type ValidationReportData

type ValidationReportData struct {
	Results      []*validation.Error      // Validation errors from the linter
	Categories   []*RuleCategory          // Rule categories
	Statistics   *ReportStatistics        // Statistics summary
	SpecBytes    []byte                   // Original spec bytes for source display
	Generated    time.Time                // When the report was generated
	RuleMetadata map[string]*RuleMetadata // Rule ID to metadata mapping
}

ValidationReportData contains all data needed for report generation using the new linter

Jump to

Keyboard shortcuts

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