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.
Click to show internal directories.
Click to hide internal directories.