linter

package
v0.20.5 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ShowPass = true

ShowPass is a global that will turn on and off printing files that report success

View Source
var StrictLogging = false

StrictLogging allows to print straight to stdout for prettier formatting if it is off

Functions

func GetName

func GetName(l Linter) string

GetName getter method for any Linter's name

func LintFileList

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

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

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

func (*Report) Log

func (rep *Report) Log() 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