formatter

package
v0.0.0-...-1c3dfbf Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Formatter

type Formatter struct {
	Stdout  io.Writer
	Stderr  io.Writer
	Format  string
	Fix     bool
	NoColor bool
	// contains filtered or unexported fields
}

Formatter outputs appropriate results to stdout and stderr depending on the format

func (*Formatter) PrettyPrintStderr

func (f *Formatter) PrettyPrintStderr(output string)

PrettyPrintStderr outputs the given output to stderr with an indent.

func (*Formatter) Print

func (f *Formatter) Print(issues tflint.Issues, err error, sources map[string][]byte)

Print outputs the given issues and errors according to configured format

func (*Formatter) PrintErrorParallel

func (f *Formatter) PrintErrorParallel(err error, sources map[string][]byte)

PrintErrorParallel outputs an error occurred in parallel workers. Depending on the configured format, errors may not be output immediately. This function itself is called serially, so changes to f.errInParallel are safe.

func (*Formatter) PrintParallel

func (f *Formatter) PrintParallel(issues tflint.Issues, sources map[string][]byte) error

PrintParallel outputs issues and errors in parallel workers. Errors stored with PrintErrorParallel are output, but in the default format they are output in real time, so they are ignored.

type JSONError

type JSONError struct {
	Summary  string     `json:"summary,omitempty"`
	Message  string     `json:"message"`
	Severity string     `json:"severity"`
	Range    *JSONRange `json:"range,omitempty"` // pointer so omitempty works
}

JSONError is a temporary structure for converting errors to JSON.

type JSONIssue

type JSONIssue struct {
	Rule    JSONRule    `json:"rule"`
	Message string      `json:"message"`
	Range   JSONRange   `json:"range"`
	Callers []JSONRange `json:"callers"`
}

JSONIssue is a temporary structure for converting TFLint issues to JSON.

type JSONOutput

type JSONOutput struct {
	Issues []JSONIssue `json:"issues"`
	Errors []JSONError `json:"errors"`
}

JSONOutput is a temporary structure for converting to JSON.

type JSONPos

type JSONPos struct {
	Line   int `json:"line"`
	Column int `json:"column"`
}

JSONPos is a temporary structure for converting positions to JSON.

type JSONRange

type JSONRange struct {
	Filename string  `json:"filename"`
	Start    JSONPos `json:"start"`
	End      JSONPos `json:"end"`
}

JSONRange is a temporary structure for converting ranges to JSON.

type JSONRule

type JSONRule struct {
	Name     string `json:"name"`
	Severity string `json:"severity"`
	Link     string `json:"link"`
}

JSONRule is a temporary structure for converting TFLint rules to JSON.

Jump to

Keyboard shortcuts

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