gotest2rdf

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: MIT Imports: 7 Imported by: 0

README

status PkgGoDev

gotest2rdf

gotest2rdf transforms go test -json outputs into Reviewdog Diagnostic Format.

It is useful with using reviewdog.

the image with reviewdog -reporter github-pr-review

Synopsis

go test -json ./... | gotest2rdf | reviewdog -f rdjsonl

Installation

See releases page or:

go install github.com/aereal/gotest2rdf@latest

See also

  • [cmd/test2json]: the details of go test -json.

License

See LICENSE file.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Transform

func Transform(input io.Reader, output io.Writer, opts ...Option) error

Types

type Option

type Option func(c *config)

func WithBacklogSize

func WithBacklogSize(size int) Option

type RDFDiagnostic

type RDFDiagnostic struct {
	Message  string       `json:"message"`
	Severity RDFSeverity  `json:"severity"`
	Location *RDFLocation `json:"location"`
}

RDFDiagnostic is an diagnostic representation of Reviewdog Diagnostic Format.

refs. https://github.com/reviewdog/reviewdog/blob/master/proto/rdf/jsonschema/Diagnostic.jsonschema

type RDFLocation

type RDFLocation struct {
	Path  string    `json:"path"`
	Range *RDFRange `json:"range"`
}

type RDFPosition

type RDFPosition struct {
	Line   int `json:"line,omitempty"`
	Column int `json:"column,omitempty"`
}

type RDFRange

type RDFRange struct {
	Start *RDFPosition `json:"start,omitempty"`
	End   *RDFPosition `json:"end,omitempty"`
}

type RDFSeverity

type RDFSeverity int
const (
	RDFSeverityUnknown RDFSeverity = iota
	RDFSeverityError
	RDFSeverityWarning
	RDFSeverityInfo
)

type TestEvent

type TestEvent struct {
	Time    time.Time
	Action  string
	Package string
	Test    string
	Elapsed float64
	Output  string
}

Directories

Path Synopsis
cmd
internal
cli

Jump to

Keyboard shortcuts

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