config

package
v0.0.0-...-ea6fe2d Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Global struct {
		// Excludes is an optional list of glob patterns used to exclude certain files from all formatters.
		Excludes []string
	}
	Names      []string              `toml:"-"`
	Formatters map[string]*Formatter `toml:"formatter"`
}

Config is used to represent the list of configured Formatters.

func ReadFile

func ReadFile(path string, names []string) (cfg *Config, err error)

ReadFile reads from path and unmarshals toml into a Config instance.

type Formatter

type Formatter struct {
	// Command is the command invoke when applying this Formatter.
	Command string
	// Options are an optional list of args to be passed to Command.
	Options []string
	// Includes is a list of glob patterns used to determine whether this Formatter should be applied against a path.
	Includes []string
	// Excludes is an optional list of glob patterns used to exclude certain files from this Formatter.
	Excludes []string
	// Indicates this formatter should be executed as part of a group of formatters all sharing the same pipeline key.
	Pipeline string
	// Indicates the order of precedence when executing as part of a pipeline.
	Priority int
}

Jump to

Keyboard shortcuts

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