linter

package
v0.20.9 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetName

func GetName(l Linter) string

GetName getter method for any Linter's name

Types

type Language

type Language struct {
	Regex *regexp.Regexp
	Fmt   Linter
	Chk   Linter
}

Language is used to associate a file pattern with the relevant tools to check and format

func (*Language) GetLinter

func (l *Language) GetLinter(which string) (Linter, error)

GetLinter allows for string indexing to get fmt or chk... TODO remove requirement for this function

type Linter

type Linter interface {
	Name() string
	WillRun() error
	Cleanup(wg *sync.WaitGroup)
	MaxConcurrency() int
	Run(filePath string, rep chan Report)
}

Linter is a simple interface to enable a setup and check using WillRun before executing multiple Run's

type Report

type Report struct {
	File   string
	Err    error
	StdOut io.Reader
	StdErr io.Reader
}

Report is used to state what issues a given file has

type Runner added in v0.20.8

type Runner struct {
	ShowPass      bool
	StrictLogging bool
}

Runner will handle parallel runs of linters

func (*Runner) LintFileList added in v0.20.8

func (r *Runner) LintFileList(l Linter, fileList []string) error

LintFileList simply takes a single Linter and runs it for each file

func (*Runner) Log added in v0.20.8

func (r *Runner) Log(rep *Report) error

Log simple takes all fields and pushes them to our using the default logger

Jump to

Keyboard shortcuts

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