validate

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func GetValidationMode

func GetValidationMode(validationFlag string) (bool, bool, error)

GetValidationMode converts validation mode flags to validation process flags.

func MtaYaml

func MtaYaml(projectPath, mtaFilename string,
	validateSchema, validateSemantic, strict bool, exclude string) (warning string, err error)

MtaYaml validates an MTA.yaml file.

func Mtaext added in v0.0.6

func Mtaext(projectPath, extPath string,
	validateSchema, validateSemantic, strict bool, exclude string) (warning string, err error)

Mtaext validates an MTA extension file.

Types

type FileValidationIssue added in v1.0.1

type FileValidationIssue struct {
	// Severity - the severity of the message. Possible values: "error", "warning".
	Severity string `json:"severity"`
	// Message - the validation message
	Message string `json:"message"`
	// Line - the line number of the issue
	Line int `json:"line"`
	// Column - the column number of the issue
	Column int `json:"column"`
}

type ValidationResult added in v1.0.1

type ValidationResult map[string][]FileValidationIssue

func Validate added in v1.0.1

func Validate(mtaPath string, extensions []string) ValidationResult

Validate validates an mta.yaml file and a list of mta extension files, and returns the issues for each file.

type YamlCheck

type YamlCheck func(yNode, yParentNode *yaml.Node, path []string) YamlValidationIssues

YamlCheck - validation check function type

type YamlValidationIssue

type YamlValidationIssue struct {
	// Msg - message content
	Msg string
	// Line - line number indicating issue
	Line int
	// Column - column number of the issue
	Column int
}

YamlValidationIssue - specific issue

type YamlValidationIssues

type YamlValidationIssues []YamlValidationIssue

YamlValidationIssues - list of issue's

func (YamlValidationIssues) Sort added in v0.0.6

func (issues YamlValidationIssues) Sort()

Sort sorts the validation issues by line and column number

func (YamlValidationIssues) String

func (issues YamlValidationIssues) String() string

Jump to

Keyboard shortcuts

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