processors

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StdExcludeDirRegexps = []string{
	normalizePathRegex("vendor"),
	normalizePathRegex("third_party"),
	normalizePathRegex("testdata"),
	normalizePathRegex("examples"),
	normalizePathRegex("Godeps"),
	normalizePathRegex("builtin"),
}

Functions

This section is empty.

Types

type AutogeneratedExclude

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

func NewAutogeneratedExclude

func NewAutogeneratedExclude(strict bool) *AutogeneratedExclude

func (*AutogeneratedExclude) Finish

func (*AutogeneratedExclude) Finish()

func (*AutogeneratedExclude) Name

func (*AutogeneratedExclude) Name() string

func (*AutogeneratedExclude) Process

func (p *AutogeneratedExclude) Process(issues []result.Issue) ([]result.Issue, error)

type Cgo

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

func NewCgo

func NewCgo(goenv *goutil.Env) *Cgo

func (Cgo) Finish

func (Cgo) Finish()

func (Cgo) Name

func (Cgo) Name() string

func (Cgo) Process

func (p Cgo) Process(issues []result.Issue) ([]result.Issue, error)

type Diff

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

func NewDiff

func NewDiff(cfg *config.Issues) *Diff

func (Diff) Finish

func (Diff) Finish()

func (Diff) Name

func (Diff) Name() string

func (Diff) Process

func (p Diff) Process(issues []result.Issue) ([]result.Issue, error)

type Exclude

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

func NewExclude

func NewExclude(cfg *config.Issues) *Exclude

func (Exclude) Finish

func (Exclude) Finish()

func (Exclude) Name

func (p Exclude) Name() string

func (Exclude) Process

func (p Exclude) Process(issues []result.Issue) ([]result.Issue, error)

type ExcludeRules

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

func NewExcludeRules

func NewExcludeRules(log logutils.Log, files *fsutils.Files, cfg *config.Issues) *ExcludeRules

func (ExcludeRules) Finish

func (ExcludeRules) Finish()

func (ExcludeRules) Name

func (p ExcludeRules) Name() string

func (ExcludeRules) Process

func (p ExcludeRules) Process(issues []result.Issue) ([]result.Issue, error)

type FilenameUnadjuster

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

FilenameUnadjuster is needed because a lot of linters use fset.Position(f.Pos()) to get filename. And they return adjusted filename (e.g. *.qtpl) for an issue. We need restore real .go filename to properly output it, parse it, etc.

func NewFilenameUnadjuster

func NewFilenameUnadjuster(pkgs []*packages.Package, log logutils.Log) *FilenameUnadjuster

func (*FilenameUnadjuster) Finish

func (*FilenameUnadjuster) Finish()

func (*FilenameUnadjuster) Name

func (*FilenameUnadjuster) Name() string

func (*FilenameUnadjuster) Process

func (p *FilenameUnadjuster) Process(issues []result.Issue) ([]result.Issue, error)

type Fixer

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

func NewFixer

func NewFixer(cfg *config.Config, log logutils.Log, fileCache *fsutils.FileCache) *Fixer

func (Fixer) Finish

func (Fixer) Finish()

func (Fixer) Name

func (Fixer) Name() string

func (Fixer) Process

func (p Fixer) Process(issues []result.Issue) ([]result.Issue, error)

type IdentifierMarker

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

func NewIdentifierMarker

func NewIdentifierMarker() *IdentifierMarker

func (IdentifierMarker) Finish

func (IdentifierMarker) Finish()

func (IdentifierMarker) Name

func (IdentifierMarker) Name() string

func (IdentifierMarker) Process

func (p IdentifierMarker) Process(issues []result.Issue) ([]result.Issue, error)

type InvalidIssue

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

func NewInvalidIssue

func NewInvalidIssue(log logutils.Log) *InvalidIssue

func (InvalidIssue) Finish

func (InvalidIssue) Finish()

func (InvalidIssue) Name

func (InvalidIssue) Name() string

func (InvalidIssue) Process

func (p InvalidIssue) Process(issues []result.Issue) ([]result.Issue, error)

type MaxFromLinter

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

func NewMaxFromLinter

func NewMaxFromLinter(limit int, log logutils.Log, cfg *config.Config) *MaxFromLinter

func (*MaxFromLinter) Finish

func (p *MaxFromLinter) Finish()

func (*MaxFromLinter) Name

func (*MaxFromLinter) Name() string

func (*MaxFromLinter) Process

func (p *MaxFromLinter) Process(issues []result.Issue) ([]result.Issue, error)

type MaxPerFileFromLinter

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

func NewMaxPerFileFromLinter

func NewMaxPerFileFromLinter(cfg *config.Config) *MaxPerFileFromLinter

func (*MaxPerFileFromLinter) Finish

func (*MaxPerFileFromLinter) Finish()

func (*MaxPerFileFromLinter) Name

func (*MaxPerFileFromLinter) Name() string

func (*MaxPerFileFromLinter) Process

func (p *MaxPerFileFromLinter) Process(issues []result.Issue) ([]result.Issue, error)

type MaxSameIssues

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

func NewMaxSameIssues

func NewMaxSameIssues(limit int, log logutils.Log, cfg *config.Config) *MaxSameIssues

func (*MaxSameIssues) Finish

func (p *MaxSameIssues) Finish()

func (*MaxSameIssues) Name

func (*MaxSameIssues) Name() string

func (*MaxSameIssues) Process

func (p *MaxSameIssues) Process(issues []result.Issue) ([]result.Issue, error)

type Nolint

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

func NewNolint

func NewNolint(log logutils.Log, dbManager *lintersdb.Manager, enabledLinters map[string]*linter.Config) *Nolint

func (*Nolint) Finish

func (p *Nolint) Finish()

func (*Nolint) Name

func (*Nolint) Name() string

func (*Nolint) Process

func (p *Nolint) Process(issues []result.Issue) ([]result.Issue, error)

type PathPrefixer

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

PathPrefixer adds a customizable prefix to every output path

func NewPathPrefixer

func NewPathPrefixer(prefix string) *PathPrefixer

NewPathPrefixer returns a new path prefixer for the provided string

func (*PathPrefixer) Finish

func (*PathPrefixer) Finish()

Finish is implemented to satisfy the Processor interface

func (*PathPrefixer) Name

func (*PathPrefixer) Name() string

Name returns the name of this processor

func (*PathPrefixer) Process

func (p *PathPrefixer) Process(issues []result.Issue) ([]result.Issue, error)

Process adds the prefix to each path

type PathPrettifier

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

func NewPathPrettifier

func NewPathPrettifier() *PathPrettifier

func (PathPrettifier) Finish

func (PathPrettifier) Finish()

func (PathPrettifier) Name

func (PathPrettifier) Name() string

func (PathPrettifier) Process

func (PathPrettifier) Process(issues []result.Issue) ([]result.Issue, error)

type PathShortener

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

func NewPathShortener

func NewPathShortener() *PathShortener

func (PathShortener) Finish

func (PathShortener) Finish()

func (PathShortener) Name

func (PathShortener) Name() string

func (PathShortener) Process

func (p PathShortener) Process(issues []result.Issue) ([]result.Issue, error)

type Processor

type Processor interface {
	Process(issues []result.Issue) ([]result.Issue, error)
	Name() string
	Finish()
}

type Severity

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

func NewSeverity

func NewSeverity(log logutils.Log, files *fsutils.Files, cfg *config.Severity) *Severity

func (*Severity) Finish

func (*Severity) Finish()

func (*Severity) Name

func (p *Severity) Name() string

func (*Severity) Process

func (p *Severity) Process(issues []result.Issue) ([]result.Issue, error)

type SkipDirs

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

func NewSkipDirs

func NewSkipDirs(log logutils.Log, patterns, args []string, pathPrefix string) (*SkipDirs, error)

func (*SkipDirs) Finish

func (p *SkipDirs) Finish()

func (*SkipDirs) Name

func (*SkipDirs) Name() string

func (*SkipDirs) Process

func (p *SkipDirs) Process(issues []result.Issue) ([]result.Issue, error)

type SkipFiles

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

func NewSkipFiles

func NewSkipFiles(patterns []string, pathPrefix string) (*SkipFiles, error)

func (SkipFiles) Finish

func (SkipFiles) Finish()

func (SkipFiles) Name

func (SkipFiles) Name() string

func (SkipFiles) Process

func (p SkipFiles) Process(issues []result.Issue) ([]result.Issue, error)

type SortResults

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

func NewSortResults

func NewSortResults(cfg *config.Config) *SortResults

func (SortResults) Finish

func (SortResults) Finish()

func (SortResults) Name

func (SortResults) Name() string

func (SortResults) Process

func (p SortResults) Process(issues []result.Issue) ([]result.Issue, error)

Process is performing sorting of the result issues.

type SourceCode

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

func NewSourceCode

func NewSourceCode(lc *fsutils.LineCache, log logutils.Log) *SourceCode

func (SourceCode) Finish

func (SourceCode) Finish()

func (SourceCode) Name

func (SourceCode) Name() string

func (SourceCode) Process

func (p SourceCode) Process(issues []result.Issue) ([]result.Issue, error)

type UniqByLine

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

func NewUniqByLine

func NewUniqByLine(cfg *config.Config) *UniqByLine

func (*UniqByLine) Finish

func (*UniqByLine) Finish()

func (*UniqByLine) Name

func (*UniqByLine) Name() string

func (*UniqByLine) Process

func (p *UniqByLine) Process(issues []result.Issue) ([]result.Issue, error)

Jump to

Keyboard shortcuts

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