formatters

package
v2.10.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoFormatProvider

type AutoFormatProvider struct {
	HCLFmt       format.Provider
	ProtoFmt     format.Provider
	YAMLFmt      format.Provider
	ShFmt        format.Provider
	DockerFmt    format.Provider
	DartFmt      format.Provider
	TerraformFmt format.Provider
	SwiftFmt     format.Provider
	GoFmt        format.Provider
}

func (*AutoFormatProvider) DetectFormatterFromContent

func (me *AutoFormatProvider) DetectFormatterFromContent(ctx context.Context, filename string, br io.ReadSeeker) (format.Provider, bool)

func (*AutoFormatProvider) DetectFormatterFromFilenameGlobs

func (me *AutoFormatProvider) DetectFormatterFromFilenameGlobs(ctx context.Context, filename string) (format.Provider, bool)

func (*AutoFormatProvider) GetFormatter

func (me *AutoFormatProvider) GetFormatter(ctx context.Context, formatter string, filename string, content io.ReadSeeker) (format.Provider, error)

func (*AutoFormatProvider) GetFormatterByLangID

func (me *AutoFormatProvider) GetFormatterByLangID(ctx context.Context, lang string) (format.Provider, bool)

type LanguageConfig

type LanguageConfig struct {
	LangIds       []string
	FilenameGlobs []string
	ProviderFunc  func(me *AutoFormatProvider) format.Provider
}

func RegisterLanguageConfig

func RegisterLanguageConfig(config *LanguageConfig) *LanguageConfig

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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