validation

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SeverityError   = "error"
	SeverityWarning = "warning"
)

Severity constants

Variables

This section is empty.

Functions

func DetectDefaultReporter

func DetectDefaultReporter() string

func DoCheckReport

func DoCheckReport(result Check, reportingFormat string) error

Types

type Check

type Check interface {
	AddResult(CheckResult)
	RemoveByIdentifier([]ToolConfigIgnore) Check
	GetResults() []CheckResult
	HasErrors() bool
}

Check interface for validation checking

type CheckResult

type CheckResult struct {
	// The path to the file that was checked
	Path string `json:"path"`
	// The line number of the issue
	Line    int    `json:"line"`
	Message string `json:"message"`
	// The severity of the issue
	Severity string `json:"severity"`

	Identifier string `json:"identifier"`
}

CheckResult represents a validation result

type GitLabCodeQualityIssue

type GitLabCodeQualityIssue struct {
	Description string                    `json:"description"`
	CheckName   string                    `json:"check_name"`
	Fingerprint string                    `json:"fingerprint"`
	Severity    string                    `json:"severity"`
	Location    GitLabCodeQualityLocation `json:"location"`
}

type GitLabCodeQualityLines

type GitLabCodeQualityLines struct {
	Begin int `json:"begin"`
}

type GitLabCodeQualityLocation

type GitLabCodeQualityLocation struct {
	Path  string                 `json:"path"`
	Lines GitLabCodeQualityLines `json:"lines"`
}

type JUnitTestCase

type JUnitTestCase struct {
	Name      string            `xml:"name,attr"`
	ClassName string            `xml:"classname,attr"`
	Failure   *JUnitTestFailure `xml:"failure,omitempty"`
	Error     *JUnitTestError   `xml:"error,omitempty"`
}

type JUnitTestError

type JUnitTestError struct {
	Message string `xml:"message,attr"`
	Type    string `xml:"type,attr"`
	Content string `xml:",chardata"`
}

type JUnitTestFailure

type JUnitTestFailure struct {
	Message string `xml:"message,attr"`
	Type    string `xml:"type,attr"`
	Content string `xml:",chardata"`
}

type JUnitTestSuite

type JUnitTestSuite struct {
	XMLName  xml.Name        `xml:"testsuite"`
	Name     string          `xml:"name,attr"`
	Tests    int             `xml:"tests,attr"`
	Failures int             `xml:"failures,attr"`
	Errors   int             `xml:"errors,attr"`
	TestCase []JUnitTestCase `xml:"testcase"`
}

type ToolConfigIgnore

type ToolConfigIgnore struct {
	Identifier string `yaml:"identifier"`
	Path       string `yaml:"path,omitempty"`
	Message    string `yaml:"message,omitempty"`
}

ToolConfigIgnore represents a configuration item to ignore during validation

func (ToolConfigIgnore) JSONSchema

func (c ToolConfigIgnore) JSONSchema() *jsonschema.Schema

JSONSchema generates the JSON schema for ToolConfigIgnore

func (*ToolConfigIgnore) UnmarshalYAML

func (c *ToolConfigIgnore) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML implements custom YAML unmarshaling for ToolConfigIgnore

Jump to

Keyboard shortcuts

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