reporter

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoLintCommentAnnotation  = "nolint"
	NoStyleCommentAnnotation = "nostyle"
	LintIgnore               = "lint:ignore"
	IgnoreAll                = "all"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Option added in v0.3.2

type Option func(*Reporter)

func DisableLintIgnore added in v0.3.2

func DisableLintIgnore() Option

DisableLintIgnore disables handling for '//lint:ignore'.

func DisableNoLint added in v0.3.2

func DisableNoLint() Option

DisableNoLint disables handling for '//nolint:*'.

func ExcludeFiles added in v0.20.0

func ExcludeFiles(configDir string, files []string) Option

ExcludeFiles excludes files from the report.

func IgnoreAnotation added in v0.3.2

func IgnoreAnotation(s string) Option

IgnoreAnotation sets the annotation to ignore the report.

func IncludeGenerated added in v0.4.0

func IncludeGenerated() Option

IncludeGenerated includes generated codes in the report.

func Prefix added in v0.3.2

func Prefix(s string) Option

Prefix sets the prefix of the report.

type Reporter

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

Reporter is a wrapper of analysis.Pass.Reportf.

func New

func New(name string, pass *analysis.Pass, opts ...Option) (*Reporter, error)

New returns a new Reporter.

func (*Reporter) Append

func (r *Reporter) Append(pos token.Pos, msg string)

Append appends token.Pos and message to the report.

func (*Reporter) AppendOr added in v0.18.2

func (r *Reporter) AppendOr(pos token.Pos, end token.Pos, msg string)

AppendOr appends posititons (start, end) and message to the report.

func (*Reporter) Report

func (r *Reporter) Report()

Report reports all reports.

Jump to

Keyboard shortcuts

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