shipshape

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package shipshape provides the basic types and base functions for parsing config, running checks as well as the file & yaml checks.

Index

Constants

This section is empty.

Variables

View Source
var OutputFormats = []string{"json", "junit", "simple", "table"}
View Source
var RunConfig config.Config
View Source
var RunResultList result.ResultList

Functions

func FetchConfigData added in v0.2.0

func FetchConfigData(files []string) ([][]byte, error)

func Init added in v0.2.0

func Init(projectDir string, configFiles []string, checkTypesToRun []string, excludeDb bool, remediate bool, logLevel string, lagoonApiBaseUrl string, lagoonApiToken string) error

func JUnit added in v0.2.0

func JUnit(w *bufio.Writer)

JUnit outputs the checks results in the JUnit XML format.

func ParseConfigData added in v0.2.0

func ParseConfigData(configData [][]byte) error

func ProcessCheck added in v0.2.0

func ProcessCheck(rl *result.ResultList, c config.Check)

func ReadAndParseConfig

func ReadAndParseConfig(projectDir string, files []string) error

func RunChecks added in v0.2.0

func RunChecks()

func SimpleDisplay added in v0.2.0

func SimpleDisplay(w *bufio.Writer)

SimpleDisplay outputs only failures to the writer.

func TableDisplay added in v0.2.0

func TableDisplay(w *tabwriter.Writer)

TableDisplay generates the tabular output for the ResultList.

Types

type JUnitError

type JUnitError struct {
	XMLName xml.Name `xml:"error"`
	Message string   `xml:"message,attr"`
}

type JUnitTestCase

type JUnitTestCase struct {
	XMLName   xml.Name `xml:"testcase"`
	Name      string   `xml:"name,attr"`
	ClassName string   `xml:"classname,attr"`
	Errors    []JUnitError
}

type JUnitTestSuite

type JUnitTestSuite struct {
	XMLName   xml.Name `xml:"testsuite"`
	Name      string   `xml:"name,attr"`
	Tests     int      `xml:"tests,attr"`
	Errors    int      `xml:"errors,attr"`
	TestCases []JUnitTestCase
}

type JUnitTestSuites

type JUnitTestSuites struct {
	XMLName    xml.Name `xml:"testsuites"`
	Tests      uint32   `xml:"tests,attr"`
	Errors     uint32   `xml:"errors,attr"`
	TestSuites []JUnitTestSuite
}

JUnit format taken from https://llg.cubic.org/docs/junit/.

Jump to

Keyboard shortcuts

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