validator

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 8 Imported by: 0 modules, 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ValidationIssue

type ValidationIssue struct {
	Level   ValidationLevel
	Message string
	File    string
	Line    int
	Hint    string
}

ValidationIssue represents a single validation problem

type ValidationLevel

type ValidationLevel string

ValidationLevel represents the severity of a validation issue

const (
	LevelError   ValidationLevel = "error"
	LevelWarning ValidationLevel = "warning"
	LevelInfo    ValidationLevel = "info"
)

type ValidationResult

type ValidationResult struct {
	Valid  bool
	Issues []ValidationIssue
}

ValidationResult holds the results of a validation check

func NewValidationResult

func NewValidationResult() *ValidationResult

NewValidationResult creates a new validation result

func ValidateKit

func ValidateKit(path string) *ValidationResult

ValidateKit validates a kit directory

func (*ValidationResult) AddError

func (r *ValidationResult) AddError(message string, file string, line int)

AddError adds an error-level issue

func (*ValidationResult) AddErrorWithHint

func (r *ValidationResult) AddErrorWithHint(message, file string, line int, hint string)

AddErrorWithHint adds an error-level issue with a hint for context.

func (*ValidationResult) AddInfo

func (r *ValidationResult) AddInfo(message string, file string, line int)

AddInfo adds an info-level issue

func (*ValidationResult) AddWarning

func (r *ValidationResult) AddWarning(message string, file string, line int)

AddWarning adds a warning-level issue

func (*ValidationResult) ErrorCount

func (r *ValidationResult) ErrorCount() int

ErrorCount returns the number of errors

func (*ValidationResult) Format

func (r *ValidationResult) Format() string

Format returns a formatted string representation

func (*ValidationResult) HasErrors

func (r *ValidationResult) HasErrors() bool

HasErrors returns true if there are any error-level issues

func (*ValidationResult) Merge

func (r *ValidationResult) Merge(other *ValidationResult)

Merge combines another validation result into this one

func (*ValidationResult) WarningCount

func (r *ValidationResult) WarningCount() int

WarningCount returns the number of warnings

Jump to

Keyboard shortcuts

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