lib

package
v0.55.2 Latest Latest
Warning

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

Go to latest
Published: May 12, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrLintFailure error is returned when there is a linting error
	ErrLintFailure = errors.New("lint error")
	// ErrInternalFailure error is returned when there is a parsing, internal, or runtime error.
	ErrInternalFailure = errors.New("parsing, internal or runtime errors")
)

Functions

func Lint

func Lint(args []string, stdout, stderr io.Writer) error

Lint is used to lint Protocol Buffer files with the protolint tool. It takes an array of strings (args) representing command line arguments, as well as two io.Writer instances (stdout and stderr) to which the output of the command should be written. It returns an error in the case of a linting error (ErrLintFailure) or a parsing, internal, or runtime error (ErrInternalFailure). Otherwise, it returns nil on success.

func SetLintRunner added in v0.55.0

func SetLintRunner(runner LintRunner)

SetLintRunner sets the runner used by the Lint function

Types

type LintRunner added in v0.55.0

type LintRunner interface {
	Run(args []string, stdout, stderr io.Writer) osutil.ExitCode
}

LintRunner is an interface for running lint commands

type MockLintRunner added in v0.55.0

type MockLintRunner struct{}

MockLintRunner is a mock implementation of LintRunner for testing

func (*MockLintRunner) Run added in v0.55.0

func (r *MockLintRunner) Run(args []string, stdout, stderr io.Writer) osutil.ExitCode

Run implements the LintRunner interface for testing

Jump to

Keyboard shortcuts

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