formatters

package
v0.48.4 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatCSV

func FormatCSV(w io.Writer, results []result.Result, _ string, _ ...FormatterOption) error

func FormatCheckStyle

func FormatCheckStyle(w io.Writer, results []result.Result, _ string, _ ...FormatterOption) error

func FormatDefault

func FormatDefault(_ io.Writer, results []result.Result, _ string, options ...FormatterOption) error

func FormatJSON

func FormatJSON(w io.Writer, results []result.Result, _ string, options ...FormatterOption) error

func FormatJUnit

func FormatJUnit(w io.Writer, results []result.Result, _ string, options ...FormatterOption) error

func FormatSarif

func FormatSarif(w io.Writer, results []result.Result, baseDir string, _ ...FormatterOption) error

func FormatText

func FormatText(writer io.Writer, results []result.Result, _ string, options ...FormatterOption) error

Types

type Formatter

type Formatter func(w io.Writer, results []result.Result, baseDir string, options ...FormatterOption) error

Formatter formats scan results into a specific format

type FormatterOption

type FormatterOption int
const (
	ConciseOutput FormatterOption = iota
	IncludePassed
)

type JSONOutput

type JSONOutput struct {
	Results []result.Result `json:"results"`
}

type JUnitFailure

type JUnitFailure struct {
	Message  string `xml:"message,attr"`
	Type     string `xml:"type,attr"`
	Contents string `xml:",chardata"`
}

JUnitFailure contains data related to a failed test.

type JUnitTestCase

type JUnitTestCase struct {
	XMLName   xml.Name      `xml:"testcase"`
	Classname string        `xml:"classname,attr"`
	Name      string        `xml:"name,attr"`
	Time      string        `xml:"time,attr"`
	Failure   *JUnitFailure `xml:"failure,omitempty"`
}

JUnitTestCase is a single test case with its result.

type JUnitTestSuite

type JUnitTestSuite struct {
	XMLName   xml.Name        `xml:"testsuite"`
	Name      string          `xml:"name,attr"`
	Failures  string          `xml:"failures,attr"`
	Tests     string          `xml:"tests,attr"`
	TestCases []JUnitTestCase `xml:"testcase"`
}

JUnitTestSuite is a single JUnit test suite which may contain many testcases.

Jump to

Keyboard shortcuts

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