bufanalysis

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintFileAnnotations

func PrintFileAnnotations(writer io.Writer, fileAnnotations []FileAnnotation, asJSON bool) error

PrintFileAnnotations prints the file annotations separated by newlines.

func SortFileAnnotations

func SortFileAnnotations(fileAnnotations []FileAnnotation)

SortFileAnnotations sorts the FileAnnotations.

The order of sorting is:

ExternalFilePath
StartLine
StartColumn
Type
Message
EndLine
EndColumn

Types

type FileAnnotation

type FileAnnotation interface {
	fmt.Stringer
	json.Marshaler
	// FileRef is the FileRef for this annotation.
	//
	// This may be nil.
	FileRef() bufimage.FileRef

	// StartLine is the starting line.
	//
	// If the starting line is not known, this will be 0.
	StartLine() int
	// StartColumn is the starting column.
	//
	// If the starting column is not known, this will be 0.
	StartColumn() int
	// EndLine is the ending line.
	//
	// If the ending line is not known, this will be 0.
	// If the ending line is the same as the starting line, this will be explicitly
	// set to the same value as start_line.
	EndLine() int
	// EndColumn is the ending column.
	//
	// If the ending column is not known, this will be 0.
	// If the ending column is the same as the starting column, this will be explicitly
	// set to the same value as start_column.
	EndColumn() int
	// Type is the type of annotation, typically an ID representing a failure type.
	Type() string
	// Message is the message of the annotation.
	Message() string
}

FileAnnotation is a file annotation.

func NewFileAnnotation

func NewFileAnnotation(
	fileRef bufimage.FileRef,
	startLine int,
	startColumn int,
	endLine int,
	endColumn int,
	typeString string,
	message string,
) FileAnnotation

NewFileAnnotation returns a new FileAnnotation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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