format

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTabWriter added in v2.1.0

func BuildTabWriter(cfg Configuration, writer io.Writer) *tabwriter.Writer

func Format

func Format(ctx context.Context, provider Provider, cfg ConfigurationProvider, filename string, fle io.Reader) (io.Reader, error)

Types

type Configuration

type Configuration interface {
	UseTabs() bool
	IndentSize() int
	TrimMultipleEmptyLines() bool
	OneBracketPerLine() bool
}

func NewBasicConfigurationProvider

func NewBasicConfigurationProvider(tabs bool, indentSize int, trimMultipleEmptyLines bool, onebracket bool) Configuration

type ConfigurationProvider

type ConfigurationProvider interface {
	GetConfigurationForFileType(ctx context.Context, filename string) (Configuration, error)
}

type Provider

type Provider interface {
	Format(ctx context.Context, cfg Configuration, reader io.Reader) (io.Reader, error)
	Targets() []string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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