formatters

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package formatters provides the base interface type for different output formatters to implement

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomFormatter

type CustomFormatter struct {
	// contains filtered or unexported fields
}

CustomFormatter is a formatter that is configurable via a template string

func NewCustomFormatter

func NewCustomFormatter(templateString string) (ret *CustomFormatter, err error)

NewCustomFormatter returns a CustomFormatter struct

func (*CustomFormatter) Format

func (f *CustomFormatter) Format(violations rules.RuleViolationList)

Format is the function to call to get the formatted output

type DefaultFormatter

type DefaultFormatter struct {
	// contains filtered or unexported fields
}

DefaultFormatter is the formatter used by default for CLI output

func NewDefaultFormatter

func NewDefaultFormatter() *DefaultFormatter

NewDefaultFormatter returns a DefaultFormatter struct

func (*DefaultFormatter) Format

func (f *DefaultFormatter) Format(violations rules.RuleViolationList)

Format is the function to call to get the formatted output

type Formatter

type Formatter interface {
	Format(violations rules.RuleViolationList)
}

Formatter is the base interface type to implement for formatters

type JSONFormatter

type JSONFormatter struct {
	// contains filtered or unexported fields
}

JSONFormatter is the formatter used for JSON output

func NewJSONFormatter

func NewJSONFormatter() *JSONFormatter

NewJSONFormatter returns a JSONFormatter struct

func (*JSONFormatter) Format

func (f *JSONFormatter) Format(violations rules.RuleViolationList)

Format is the function to call to get the formatted JSON output

Jump to

Keyboard shortcuts

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