lint

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetReporter added in v0.20.2

func GetReporter(value string) (report.Reporter, error)

GetReporter returns a reporter from the specified key.

Types

type CmdLint

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

CmdLint is a lint command.

func NewCmdLint

func NewCmdLint(
	flags Flags,
	stdout io.Writer,
	stderr io.Writer,
) (*CmdLint, error)

NewCmdLint creates a new CmdLint.

func (*CmdLint) Run

func (c *CmdLint) Run() osutil.ExitCode

Run lints to proto files.

type CmdLintConfig

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

CmdLintConfig is a config for lint command.

func NewCmdLintConfig

func NewCmdLintConfig(
	externalConfig config.ExternalConfig,
	flags Flags,
) CmdLintConfig

NewCmdLintConfig creates a new CmdLintConfig.

func (CmdLintConfig) GenRules

func (c CmdLintConfig) GenRules(
	f file.ProtoFile,
) ([]rule.HasApply, error)

GenRules generates rules which are applied to the filename path.

type Flags

type Flags struct {
	*flag.FlagSet

	FilePaths      []string
	ConfigPath     string
	ConfigDirPath  string
	FixMode        bool
	Reporter       report.Reporter
	OutputFilePath string
	Verbose        bool
	Plugins        []shared.RuleSet
}

Flags represents a set of lint flag parameters.

func NewFlags

func NewFlags(
	args []string,
) (Flags, error)

NewFlags creates a new Flags.

Jump to

Keyboard shortcuts

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