yam

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 14 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDidNotPassLintCheck = errors.New("input did not pass the lint check")
)

Functions

func ExecDiff

func ExecDiff(want, got []byte) error

func Format

func Format(fsys rwfs.FS, paths []string, options FormatOptions) error

func Lint

func Lint(fsys fs.FS, paths []string, handler DiffHandler, options FormatOptions) error

Types

type DiffHandler

type DiffHandler func(want, got []byte) error

type FormatOptions

type FormatOptions struct {
	// EncodeOptions specifies the encoder-specific format options.
	EncodeOptions formatted.EncodeOptions

	// FinalNewline specifies whether to ensure the input has a final newline before
	// further formatting is applied.
	FinalNewline bool `mapstructure:"final-newline"`

	// TrimTrailingWhitespace specifies whether to trim any trailing space
	// characters from each line before further formatting is applied.
	TrimTrailingWhitespace bool `mapstructure:"trim-lines"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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