analyzer

package
v0.24.4-beta Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Analyzer

type Analyzer interface {
	AnalyzeSpecification(specFilePath string, specFileContent []byte) (*spec.Specification, []CheckResult, *SpecError)
	AllFilesContent(specFilePath string) map[string][]byte
}

func NewAnalyzer

func NewAnalyzer(
	specParser spec.SpecParser,
	checkEvaluator check.CheckEvaluator,
	fileFetcher files.FileFetcher,
	parserProvider parsers.ParserProvider) Analyzer

type CheckResult

type CheckResult struct {
	Status        CheckStatus             `json:"status"`         // whether the check passed, failed or was skipped
	ResultComment string                  `json:"result_comment"` // an error msg or comment about the result
	Field         spec.FieldSpec          `json:"field"`          // the rule that was checked
	CheckNum      int                     `json:"check_num"`      // the number of the check that was evaluated
	TokenList     []TokenLocationWithFile `json:"token_list"`     // list of tokens involved in the check
}

type CheckStatus

type CheckStatus int
const (
	CheckPassed CheckStatus = iota
	CheckFailed
	CheckSkipped
)

type SpecError

type SpecError struct {
	AnalyzerMsg string                  `json:"analyzer_msg"`
	ErrorMsgs   []string                `json:"error_msgs"`
	TokenList   []TokenLocationWithFile `json:"token_list"` // list of tokens involved in the error
}

type TokenLocationWithFile

type TokenLocationWithFile struct {
	File     string                `json:"file"`
	Location parsers.TokenLocation `json:"location"`
}

TokenLocationWithFile is a TokenLocation enhanced with a file path; representing the file the token is in.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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