linter

package
v0.18.15 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Language

type Language struct {
	Name  string
	Match *regexp.Regexp // Regex to identify files
	Fmt   Linter         // Formatting tool
	Chk   Linter         // Convention linting tool - Errors on any problem
}

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

func (Language) GetLinter

func (l Language) GetLinter(which string) Linter

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
	Run(filepath string, rep chan Report)
}

Linter is a simple inteface 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