lint

package
v0.49.2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAutoDisableType added in v0.40.0

func GetAutoDisableType(value string) (autodisable.PlacementType, error)

GetAutoDisableType returns a type from the specified key.

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
	AutoDisableType           autodisable.PlacementType
	OutputFilePath            string
	Verbose                   bool
	NoErrorOnUnmatchedPattern bool
	Plugins                   []shared.RuleSet
	AdditionalReporters       reporterStreamFlags
}

Flags represents a set of lint flag parameters.

func NewFlags

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

NewFlags creates a new Flags.

type ParseError added in v0.23.0

type ParseError struct {
	Message string
}

ParseError represents the error returned through a parsing exception.

func (ParseError) Error added in v0.23.0

func (p ParseError) Error() string

Jump to

Keyboard shortcuts

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