formatrunner

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const GolinesVersion = "v0.13.0"

Variables

This section is empty.

Functions

func FormatSource

func FormatSource(path string, src []byte, opts Options) ([]byte, []readability.Issue, error)

Types

type AdviceFailedError added in v0.4.0

type AdviceFailedError struct {
	Issues []readability.Issue
}

func (AdviceFailedError) Error added in v0.4.0

func (err AdviceFailedError) Error() string

type CheckFailedError

type CheckFailedError struct {
	ChangedFiles []string
}

func (CheckFailedError) Error

func (err CheckFailedError) Error() string

type Mode

type Mode string
const (
	Check Mode = "check"
	Write Mode = "write"
)

type Options

type Options struct {
	Mode            Mode
	Paths           []string
	MaxLen          int
	GoToolchain     string
	SkipGoLines     bool
	SkipReadability bool
	Advice          bool
	AdviceFail      bool
	Mutate          bool
	Jobs            int
	Diff            bool
	DiffMaxBytes    int
	IncludeHidden   bool
	Exclude         []string

	Progress func(ProgressEvent)
	// contains filtered or unexported fields
}

type ProgressEvent added in v0.1.3

type ProgressEvent struct {
	Current int
	Total   int
	File    string
	Done    bool
}

type Result

type Result struct {
	CheckedFiles []string
	ChangedFiles []string
	Diff         string
	Issues       []readability.Issue
}

func Run

func Run(opts Options) (Result, error)

Jump to

Keyboard shortcuts

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