nolint

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package nolint implements the ability for consumers of the linters exposed in lintroller to explicitly ignore linter errors for the linters that report on specific lines.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pass

type Pass struct {
	*analysis.Pass
	// contains filtered or unexported fields
}

Pass is a wrapper around *analysis.Pass that accounts for nolint directives. Please never initialize this type directly, only through PassWithNoLint. If you initialize this type directly, it will essentially be a no-op wrapper around *analysis.Pass.

func PassWithNoLint

func PassWithNoLint(linter string, pass *analysis.Pass) *Pass

PassWithNoLint returns a wrapped version of *analysis.Pass as Pass with nolint directives identified for the provided linter name.

func (*Pass) Reportf

func (p *Pass) Reportf(pos token.Pos, format string, args ...interface{})

Reportf is a wrapper around *analysis.Pass.Reportf that respects nolint directives stored in *Pass.noLint, which are gathered in PassWithNoLint.

type Reporter

type Reporter interface {
	Reportf(pos token.Pos, format string, args ...interface{})
}

Reporter is a convienance interface that allows Pass to be provided to helper functions in linters who need to be able to use Reportf.

Jump to

Keyboard shortcuts

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