checker

package
v0.0.0-...-27f9dfe Latest Latest
Warning

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

Go to latest
Published: May 29, 2018 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package checker can load files/packages and run linters on them

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker struct {
	// contains filtered or unexported fields
}

Checker is the coordinator/executor of the linting process

func NewChecker

func NewChecker(conf *config.Config, linter []api.Linter) (*Checker, error)

NewChecker constructs a new checker according to the provided arguments

func (*Checker) Load

func (c *Checker) Load(paths ...string) error

Load loads/parses the specified paths see imports.ResolvePaths how paths are resolved

func (*Checker) Run

func (c *Checker) Run() []*issue.LinterIssue

Run runs the checker on the loaded paths

type FileWriter

type FileWriter struct {
	// contains filtered or unexported fields
}

FileWriter implements the IssueWriter interface and writes the issues serialized by the outtemplate to the provided files

func (*FileWriter) Write

func (w *FileWriter) Write(issue *issue.LinterIssue)

type IssueReporter

type IssueReporter struct {
	// contains filtered or unexported fields
}

IssueReporter implements the api.Reporter interface and filters/collects issues and passes them to the writer

type IssueReporterEntry

type IssueReporterEntry struct {
	*IssueReporter
	// contains filtered or unexported fields
}

IssueReporterEntry is a concrete reporter of a linter's invocation

func (*IssueReporterEntry) Debug

func (r *IssueReporterEntry) Debug(msg string, fields ...interface{})

Debug prints debug messages

func (*IssueReporterEntry) Report

func (r *IssueReporterEntry) Report(iss *api.Issue)

Report checks if an issue gets filtered if so the issue is ignored otherwise it adds the issue to the list of all issues and passes it to the writer

type IssueWriter

type IssueWriter interface {
	Write(issue *issue.LinterIssue)
}

IssueWriter writes an issue to a target

Directories

Path Synopsis
Package filter provides filters to filter out excluded issues
Package filter provides filters to filter out excluded issues
Package issue provides models/helpers to the internal representation of issues
Package issue provides models/helpers to the internal representation of issues

Jump to

Keyboard shortcuts

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