Documentation ¶
Index ¶
- Constants
- func PrintDoubleGroupJSON(groupReports map[string]map[string][]Report) error
- func PrintDoubleGroupStdout(groupReport map[string]map[string][]Report) error
- func PrintSingleGroupJSON(groupReports map[string][]Report) error
- func PrintSingleGroupStdout(groupReport map[string][]Report) error
- func PrintTripleGroupJSON(groupReports map[string]map[string]map[string][]Report) error
- func PrintTripleGroupStdout(groupReport map[string]map[string]map[string][]Report) error
- type JSONReporter
- type JunitReporter
- type Message
- type Property
- type Report
- type Reporter
- type SARIFLog
- type SARIFReporter
- type Skipped
- type StdoutReporter
- type SystemErr
- type SystemOut
- type Testcase
- type TestcaseError
- type TestcaseFailure
- type Testsuite
- type Testsuites
Constants ¶
const DriverInfoURI = "https://github.com/Boeing/config-file-validator"
const DriverName = "config-file-validator"
const DriverVersion = "1.8.0"
const (
Header = `<?xml version="1.0" encoding="UTF-8"?>` + "\n"
)
const SARIFSchema = "https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json"
const SARIFVersion = "2.1.0"
Variables ¶
This section is empty.
Functions ¶
func PrintDoubleGroupJSON ¶ added in v1.7.0
Prints the report for when two groups are passed in the groupby flag
func PrintDoubleGroupStdout ¶ added in v1.6.0
Prints the report for when two groups are passed in the groupby flag
func PrintSingleGroupJSON ¶ added in v1.7.0
Prints the report for when one group is passed in the groupby flag
func PrintSingleGroupStdout ¶ added in v1.6.0
There is repeated code in the following two functions. Trying to consolidate the code into one function is difficult because of the output format
func PrintTripleGroupJSON ¶ added in v1.7.0
Prints the report for when three groups are passed in the groupby flag
Types ¶
type JSONReporter ¶ added in v1.7.0
type JSONReporter struct {
// contains filtered or unexported fields
}
func NewJSONReporter ¶ added in v1.7.0
func NewJSONReporter(outputDest string) *JSONReporter
func (JSONReporter) Print ¶ added in v1.7.0
func (jr JSONReporter) Print(reports []Report) error
Print implements the Reporter interface by outputting the report content to stdout as JSON if outputDest flag is provided, output results to a file.
type JunitReporter ¶ added in v1.6.0
type JunitReporter struct {
// contains filtered or unexported fields
}
func NewJunitReporter ¶ added in v1.6.0
func NewJunitReporter(outputDest string) *JunitReporter
func (JunitReporter) Print ¶ added in v1.6.0
func (jr JunitReporter) Print(reports []Report) error
type Report ¶
type Report struct { FileName string FilePath string IsValid bool ValidationError error IsQuiet bool }
The Report object stores information about the report and the results of the validation
type Reporter ¶
Print accepts an array of Report objects and determines how to output the contents. Output could be stdout, files, etc
type SARIFReporter ¶ added in v1.8.0
type SARIFReporter struct {
// contains filtered or unexported fields
}
func NewSARIFReporter ¶ added in v1.8.0
func NewSARIFReporter(outputDest string) *SARIFReporter
func (SARIFReporter) Print ¶ added in v1.8.0
func (sr SARIFReporter) Print(reports []Report) error
type StdoutReporter ¶
type StdoutReporter struct {
// contains filtered or unexported fields
}
func NewStdoutReporter ¶ added in v1.8.0
func NewStdoutReporter(outputDest string) *StdoutReporter
func (StdoutReporter) Print ¶
func (sr StdoutReporter) Print(reports []Report) error
Print implements the Reporter interface by outputting the report content to stdout
type Testcase ¶ added in v1.6.0
type Testcase struct { XMLName xml.Name `xml:"testcase"` Name string `xml:"name,attr"` ClassName string `xml:"classname,attr"` Assertions int `xml:"assertions,attr,omitempty"` Time float32 `xml:"time,attr,omitempty"` File string `xml:"file,attr,omitempty"` Line int `xml:"line,attr,omitempty"` Skipped *Skipped `xml:"skipped,attr,omitempty"` Properties *[]Property `xml:"properties>property,omitempty"` TestcaseError *TestcaseError `xml:"error,omitempty"` TestcaseFailure *TestcaseFailure `xml:"failure,omitempty"` }
type TestcaseError ¶ added in v1.6.0
type TestcaseFailure ¶ added in v1.6.0
type Testsuite ¶ added in v1.6.0
type Testsuite struct { XMLName xml.Name `xml:"testsuite"` Name string `xml:"name,attr"` Tests int `xml:"tests,attr,omitempty"` Failures int `xml:"failures,attr,omitempty"` Errors int `xml:"errors,attr,omitempty"` Skipped int `xml:"skipped,attr,omitempty"` Assertions int `xml:"assertions,attr,omitempty"` Time float32 `xml:"time,attr,omitempty"` Timestamp *time.Time `xml:"timestamp,attr,omitempty"` File string `xml:"file,attr,omitempty"` Testcases *[]Testcase `xml:"testcase,omitempty"` Properties *[]Property `xml:"properties>property,omitempty"` SystemOut *SystemOut `xml:"system-out,omitempty"` SystemErr *SystemErr `xml:"system-err,omitempty"` }
type Testsuites ¶ added in v1.6.0
type Testsuites struct { XMLName xml.Name `xml:"testsuites"` Name string `xml:"name,attr,omitempty"` Tests int `xml:"tests,attr,omitempty"` Failures int `xml:"failures,attr,omitempty"` Errors int `xml:"errors,attr,omitempty"` Skipped int `xml:"skipped,attr,omitempty"` Assertions int `xml:"assertions,attr,omitempty"` Time float32 `xml:"time,attr,omitempty"` Timestamp *time.Time `xml:"timestamp,attr,omitempty"` Testsuites []Testsuite `xml:"testsuite"` }
https://github.com/testmoapp/junitxml#basic-junit-xml-structure