rule

package
v1.3.9 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package rule implements revive's linting rules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddConstantRule

type AddConstantRule struct {
	sync.Mutex
	// contains filtered or unexported fields
}

AddConstantRule lints unused params in functions.

func (*AddConstantRule) Apply

func (r *AddConstantRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*AddConstantRule) Name

func (*AddConstantRule) Name() string

Name returns the rule name.

type ArgumentsLimitRule

type ArgumentsLimitRule struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ArgumentsLimitRule lints given else constructs.

func (*ArgumentsLimitRule) Apply

func (r *ArgumentsLimitRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*ArgumentsLimitRule) Name

func (*ArgumentsLimitRule) Name() string

Name returns the rule name.

type AtomicRule

type AtomicRule struct{}

AtomicRule lints given else constructs.

func (*AtomicRule) Apply

func (*AtomicRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*AtomicRule) Name

func (*AtomicRule) Name() string

Name returns the rule name.

type BannedCharsRule

type BannedCharsRule struct {
	sync.Mutex
	// contains filtered or unexported fields
}

BannedCharsRule checks if a file contains banned characters.

func (*BannedCharsRule) Apply

func (r *BannedCharsRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure

Apply applied the rule to the given file.

func (*BannedCharsRule) Name

func (*BannedCharsRule) Name() string

Name returns the rule name

type BareReturnRule

type BareReturnRule struct{}

BareReturnRule lints given else constructs.

func (*BareReturnRule) Apply

func (*BareReturnRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*BareReturnRule) Name

func (*BareReturnRule) Name() string

Name returns the rule name.

type BlankImportsRule

type BlankImportsRule struct{}

BlankImportsRule lints given else constructs.

func (*BlankImportsRule) Apply

func (r *BlankImportsRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*BlankImportsRule) Name

func (*BlankImportsRule) Name() string

Name returns the rule name.

type BoolLiteralRule

type BoolLiteralRule struct{}

BoolLiteralRule warns when logic expressions contains Boolean literals.

func (*BoolLiteralRule) Apply

func (*BoolLiteralRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*BoolLiteralRule) Name

func (*BoolLiteralRule) Name() string

Name returns the rule name.

type CallToGCRule

type CallToGCRule struct{}

CallToGCRule lints calls to the garbage collector.

func (*CallToGCRule) Apply

func (*CallToGCRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*CallToGCRule) Name

func (*CallToGCRule) Name() string

Name returns the rule name.

type CognitiveComplexityRule

type CognitiveComplexityRule struct {
	sync.Mutex
	// contains filtered or unexported fields
}

CognitiveComplexityRule lints given else constructs.

func (*CognitiveComplexityRule) Apply

func (r *CognitiveComplexityRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*CognitiveComplexityRule) Name

Name returns the rule name.

type CommentSpacingsRule added in v1.3.9

type CommentSpacingsRule struct {
	sync.Mutex
	// contains filtered or unexported fields
}

CommentSpacingsRule check the whether there is a space between the comment symbol( // ) and the start of the comment text

func (*CommentSpacingsRule) Apply added in v1.3.9

func (r *CommentSpacingsRule) Apply(file *lint.File, args lint.Arguments) []lint.Failure

Apply the rule.

func (*CommentSpacingsRule) Name added in v1.3.9

func (*CommentSpacingsRule) Name() string

Name yields this rule name.

type CommentsDensityRule added in v1.3.9

type CommentsDensityRule struct {
	sync.Mutex
	// contains filtered or unexported fields
}

CommentsDensityRule lints given else constructs.

func (*CommentsDensityRule) Apply added in v1.3.9

func (r *CommentsDensityRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*CommentsDensityRule) Name added in v1.3.9

func (*CommentsDensityRule) Name() string

Name returns the rule name.

type ConfusingNamingRule

type ConfusingNamingRule struct{}

ConfusingNamingRule lints method names that differ only by capitalization

func (*ConfusingNamingRule) Apply

func (*ConfusingNamingRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*ConfusingNamingRule) Name

func (*ConfusingNamingRule) Name() string

Name returns the rule name.

type ConfusingResultsRule

type ConfusingResultsRule struct{}

ConfusingResultsRule lints given function declarations

func (*ConfusingResultsRule) Apply

Apply applies the rule to given file.

func (*ConfusingResultsRule) Name

func (*ConfusingResultsRule) Name() string

Name returns the rule name.

type ConstantLogicalExprRule

type ConstantLogicalExprRule struct{}

ConstantLogicalExprRule warns on constant logical expressions.

func (*ConstantLogicalExprRule) Apply

Apply applies the rule to given file.

func (*ConstantLogicalExprRule) Name

Name returns the rule name.

type ContextAsArgumentRule

type ContextAsArgumentRule struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ContextAsArgumentRule lints given else constructs.

func (*ContextAsArgumentRule) Apply

func (r *ContextAsArgumentRule) Apply(file *lint.File, args lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*ContextAsArgumentRule) Name

func (*ContextAsArgumentRule) Name() string

Name returns the rule name.

type ContextKeysType

type ContextKeysType struct{}

ContextKeysType lints given else constructs.

func (*ContextKeysType) Apply

func (*ContextKeysType) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*ContextKeysType) Name

func (*ContextKeysType) Name() string

Name returns the rule name.

type CyclomaticRule

type CyclomaticRule struct {
	sync.Mutex
	// contains filtered or unexported fields
}

CyclomaticRule lints given else constructs.

func (*CyclomaticRule) Apply

func (r *CyclomaticRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*CyclomaticRule) Name

func (*CyclomaticRule) Name() string

Name returns the rule name.

type DataRaceRule

type DataRaceRule struct{}

DataRaceRule lints assignments to value method-receivers.

func (*DataRaceRule) Apply

func (*DataRaceRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*DataRaceRule) Name

func (*DataRaceRule) Name() string

Name returns the rule name.

type DeepExitRule

type DeepExitRule struct{}

DeepExitRule lints program exit at functions other than main or init.

func (*DeepExitRule) Apply

func (*DeepExitRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*DeepExitRule) Name

func (*DeepExitRule) Name() string

Name returns the rule name.

type DeferRule

type DeferRule struct {
	sync.Mutex
	// contains filtered or unexported fields
}

DeferRule lints unused params in functions.

func (*DeferRule) Apply

func (r *DeferRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*DeferRule) Name

func (*DeferRule) Name() string

Name returns the rule name.

type DotImportsRule

type DotImportsRule struct {
	sync.Mutex
	// contains filtered or unexported fields
}

DotImportsRule lints given else constructs.

func (*DotImportsRule) Apply

func (r *DotImportsRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*DotImportsRule) Name

func (*DotImportsRule) Name() string

Name returns the rule name.

type DuplicatedImportsRule

type DuplicatedImportsRule struct{}

DuplicatedImportsRule lints given else constructs.

func (*DuplicatedImportsRule) Apply

Apply applies the rule to given file.

func (*DuplicatedImportsRule) Name

func (*DuplicatedImportsRule) Name() string

Name returns the rule name.

type EarlyReturnRule

type EarlyReturnRule struct{}

EarlyReturnRule finds opportunities to reduce nesting by inverting the condition of an "if" block.

func (*EarlyReturnRule) Apply

func (e *EarlyReturnRule) Apply(file *lint.File, args lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*EarlyReturnRule) CheckIfElse added in v1.3.9

func (*EarlyReturnRule) CheckIfElse(chain ifelse.Chain, args ifelse.Args) (failMsg string)

CheckIfElse evaluates the rule against an ifelse.Chain.

func (*EarlyReturnRule) Name

func (*EarlyReturnRule) Name() string

Name returns the rule name.

type EmptyBlockRule

type EmptyBlockRule struct{}

EmptyBlockRule lints given else constructs.

func (*EmptyBlockRule) Apply

func (*EmptyBlockRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*EmptyBlockRule) Name

func (*EmptyBlockRule) Name() string

Name returns the rule name.

type EmptyLinesRule

type EmptyLinesRule struct{}

EmptyLinesRule lints empty lines in blocks.

func (*EmptyLinesRule) Apply

func (r *EmptyLinesRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*EmptyLinesRule) Name

func (*EmptyLinesRule) Name() string

Name returns the rule name.

type EnforceMapStyleRule added in v1.3.9

type EnforceMapStyleRule struct {
	sync.Mutex
	// contains filtered or unexported fields
}

EnforceMapStyleRule implements a rule to enforce `make(map[type]type)` over `map[type]type{}`.

func (*EnforceMapStyleRule) Apply added in v1.3.9

func (r *EnforceMapStyleRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*EnforceMapStyleRule) Name added in v1.3.9

func (*EnforceMapStyleRule) Name() string

Name returns the rule name.

type EnforceRepeatedArgTypeStyleRule added in v1.3.9

type EnforceRepeatedArgTypeStyleRule struct {
	sync.Mutex
	// contains filtered or unexported fields
}

EnforceRepeatedArgTypeStyleRule implements a rule to enforce repeated argument type style.

func (*EnforceRepeatedArgTypeStyleRule) Apply added in v1.3.9

func (r *EnforceRepeatedArgTypeStyleRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure

Apply applies the rule to a given file.

func (*EnforceRepeatedArgTypeStyleRule) Name added in v1.3.9

Name returns the name of the linter rule.

type EnforceSliceStyleRule added in v1.3.9

type EnforceSliceStyleRule struct {
	sync.Mutex
	// contains filtered or unexported fields
}

EnforceSliceStyleRule implements a rule to enforce `make([]type)` over `[]type{}`.

func (*EnforceSliceStyleRule) Apply added in v1.3.9

func (r *EnforceSliceStyleRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*EnforceSliceStyleRule) Name added in v1.3.9

func (*EnforceSliceStyleRule) Name() string

Name returns the rule name.

type ErrorNamingRule

type ErrorNamingRule struct{}

ErrorNamingRule lints given else constructs.

func (*ErrorNamingRule) Apply

func (*ErrorNamingRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*ErrorNamingRule) Name

func (*ErrorNamingRule) Name() string

Name returns the rule name.

type ErrorReturnRule

type ErrorReturnRule struct{}

ErrorReturnRule lints given else constructs.

func (*ErrorReturnRule) Apply

func (*ErrorReturnRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*ErrorReturnRule) Name

func (*ErrorReturnRule) Name() string

Name returns the rule name.

type ErrorStringsRule

type ErrorStringsRule struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ErrorStringsRule lints given else constructs.

func (*ErrorStringsRule) Apply

func (r *ErrorStringsRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*ErrorStringsRule) Name

func (*ErrorStringsRule) Name() string

Name returns the rule name.

type ErrorfRule

type ErrorfRule struct{}

ErrorfRule lints given else constructs.

func (*ErrorfRule) Apply

func (*ErrorfRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*ErrorfRule) Name

func (*ErrorfRule) Name() string

Name returns the rule name.

type ExportedRule

type ExportedRule struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ExportedRule lints given else constructs.

func (*ExportedRule) Apply

func (r *ExportedRule) Apply(file *lint.File, args lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*ExportedRule) Name

func (*ExportedRule) Name() string

Name returns the rule name.

type FileHeaderRule

type FileHeaderRule struct {
	sync.Mutex
	// contains filtered or unexported fields
}

FileHeaderRule lints given else constructs.

func (*FileHeaderRule) Apply

func (r *FileHeaderRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*FileHeaderRule) Name

func (*FileHeaderRule) Name() string

Name returns the rule name.

type FlagParamRule

type FlagParamRule struct{}

FlagParamRule lints given else constructs.

func (*FlagParamRule) Apply

func (*FlagParamRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*FlagParamRule) Name

func (*FlagParamRule) Name() string

Name returns the rule name.

type FunctionLength

type FunctionLength struct {
	sync.Mutex
	// contains filtered or unexported fields
}

FunctionLength lint.

func (*FunctionLength) Apply

func (r *FunctionLength) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*FunctionLength) Name

func (*FunctionLength) Name() string

Name returns the rule name.

type FunctionResultsLimitRule

type FunctionResultsLimitRule struct {
	sync.Mutex
	// contains filtered or unexported fields
}

FunctionResultsLimitRule lints given else constructs.

func (*FunctionResultsLimitRule) Apply

func (r *FunctionResultsLimitRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*FunctionResultsLimitRule) Name

Name returns the rule name.

type GetReturnRule

type GetReturnRule struct{}

GetReturnRule lints given else constructs.

func (*GetReturnRule) Apply

func (*GetReturnRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*GetReturnRule) Name

func (*GetReturnRule) Name() string

Name returns the rule name.

type IdenticalBranchesRule

type IdenticalBranchesRule struct{}

IdenticalBranchesRule warns on constant logical expressions.

func (*IdenticalBranchesRule) Apply

Apply applies the rule to given file.

func (*IdenticalBranchesRule) Name

func (*IdenticalBranchesRule) Name() string

Name returns the rule name.

type IfReturnRule

type IfReturnRule struct{}

IfReturnRule lints given else constructs.

func (*IfReturnRule) Apply

func (*IfReturnRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*IfReturnRule) Name

func (*IfReturnRule) Name() string

Name returns the rule name.

type ImportAliasNamingRule added in v1.3.9

type ImportAliasNamingRule struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ImportAliasNamingRule lints import alias naming.

func (*ImportAliasNamingRule) Apply added in v1.3.9

func (r *ImportAliasNamingRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*ImportAliasNamingRule) Name added in v1.3.9

func (*ImportAliasNamingRule) Name() string

Name returns the rule name.

type ImportShadowingRule

type ImportShadowingRule struct{}

ImportShadowingRule lints given else constructs.

func (*ImportShadowingRule) Apply

func (*ImportShadowingRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*ImportShadowingRule) Name

func (*ImportShadowingRule) Name() string

Name returns the rule name.

type ImportsBlocklistRule added in v1.3.9

type ImportsBlocklistRule struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ImportsBlocklistRule lints given else constructs.

func (*ImportsBlocklistRule) Apply added in v1.3.9

func (r *ImportsBlocklistRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*ImportsBlocklistRule) Name added in v1.3.9

func (*ImportsBlocklistRule) Name() string

Name returns the rule name.

type IncrementDecrementRule

type IncrementDecrementRule struct{}

IncrementDecrementRule lints given else constructs.

func (*IncrementDecrementRule) Apply

Apply applies the rule to given file.

func (*IncrementDecrementRule) Name

Name returns the rule name.

type IndentErrorFlowRule

type IndentErrorFlowRule struct{}

IndentErrorFlowRule lints given else constructs.

func (*IndentErrorFlowRule) Apply

func (e *IndentErrorFlowRule) Apply(file *lint.File, args lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*IndentErrorFlowRule) CheckIfElse added in v1.3.9

func (*IndentErrorFlowRule) CheckIfElse(chain ifelse.Chain, args ifelse.Args) (failMsg string)

CheckIfElse evaluates the rule against an ifelse.Chain.

func (*IndentErrorFlowRule) Name

func (*IndentErrorFlowRule) Name() string

Name returns the rule name.

type LineLengthLimitRule

type LineLengthLimitRule struct {
	sync.Mutex
	// contains filtered or unexported fields
}

LineLengthLimitRule lints given else constructs.

func (*LineLengthLimitRule) Apply

func (r *LineLengthLimitRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*LineLengthLimitRule) Name

func (*LineLengthLimitRule) Name() string

Name returns the rule name.

type MaxControlNestingRule added in v1.3.9

type MaxControlNestingRule struct {
	sync.Mutex
	// contains filtered or unexported fields
}

MaxControlNestingRule lints given else constructs.

func (*MaxControlNestingRule) Apply added in v1.3.9

func (r *MaxControlNestingRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*MaxControlNestingRule) Name added in v1.3.9

func (*MaxControlNestingRule) Name() string

Name returns the rule name.

type MaxPublicStructsRule

type MaxPublicStructsRule struct {
	sync.Mutex
	// contains filtered or unexported fields
}

MaxPublicStructsRule lints given else constructs.

func (*MaxPublicStructsRule) Apply

func (r *MaxPublicStructsRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*MaxPublicStructsRule) Name

func (*MaxPublicStructsRule) Name() string

Name returns the rule name.

type ModifiesParamRule

type ModifiesParamRule struct{}

ModifiesParamRule lints given else constructs.

func (*ModifiesParamRule) Apply

func (*ModifiesParamRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*ModifiesParamRule) Name

func (*ModifiesParamRule) Name() string

Name returns the rule name.

type ModifiesValRecRule

type ModifiesValRecRule struct{}

ModifiesValRecRule lints assignments to value method-receivers.

func (*ModifiesValRecRule) Apply

func (*ModifiesValRecRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*ModifiesValRecRule) Name

func (*ModifiesValRecRule) Name() string

Name returns the rule name.

type NestedStructs

type NestedStructs struct{}

NestedStructs lints nested structs.

func (*NestedStructs) Apply

func (*NestedStructs) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*NestedStructs) Name

func (*NestedStructs) Name() string

Name returns the rule name.

type OptimizeOperandsOrderRule

type OptimizeOperandsOrderRule struct{}

OptimizeOperandsOrderRule lints given else constructs.

func (*OptimizeOperandsOrderRule) Apply

Apply applies the rule to given file.

func (*OptimizeOperandsOrderRule) Name

Name returns the rule name.

type PackageCommentsRule

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

PackageCommentsRule lints the package comments. It complains if there is no package comment, or if it is not of the right form. This has a notable false positive in that a package comment could rightfully appear in a different file of the same package, but that's not easy to fix since this linter is file-oriented.

func (*PackageCommentsRule) Apply

func (r *PackageCommentsRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*PackageCommentsRule) Name

func (*PackageCommentsRule) Name() string

Name returns the rule name.

type RangeRule

type RangeRule struct{}

RangeRule lints given else constructs.

func (*RangeRule) Apply

func (*RangeRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*RangeRule) Name

func (*RangeRule) Name() string

Name returns the rule name.

type RangeValAddress

type RangeValAddress struct{}

RangeValAddress lints

func (*RangeValAddress) Apply

func (*RangeValAddress) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*RangeValAddress) Name

func (*RangeValAddress) Name() string

Name returns the rule name.

type RangeValInClosureRule

type RangeValInClosureRule struct{}

RangeValInClosureRule lints given else constructs.

func (*RangeValInClosureRule) Apply

Apply applies the rule to given file.

func (*RangeValInClosureRule) Name

func (*RangeValInClosureRule) Name() string

Name returns the rule name.

type ReceiverNamingRule

type ReceiverNamingRule struct{}

ReceiverNamingRule lints given else constructs.

func (*ReceiverNamingRule) Apply

func (*ReceiverNamingRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*ReceiverNamingRule) Name

func (*ReceiverNamingRule) Name() string

Name returns the rule name.

type RedefinesBuiltinIDRule

type RedefinesBuiltinIDRule struct{}

RedefinesBuiltinIDRule warns when a builtin identifier is shadowed.

func (*RedefinesBuiltinIDRule) Apply

Apply applies the rule to given file.

func (*RedefinesBuiltinIDRule) Name

Name returns the rule name.

type RedundantImportAlias added in v1.3.9

type RedundantImportAlias struct{}

RedundantImportAlias lints given else constructs.

func (*RedundantImportAlias) Apply added in v1.3.9

Apply applies the rule to given file.

func (*RedundantImportAlias) Name added in v1.3.9

func (*RedundantImportAlias) Name() string

Name returns the rule name.

type StringFormatRule

type StringFormatRule struct{}

StringFormatRule lints strings and/or comments according to a set of regular expressions given as Arguments

func (*StringFormatRule) Apply

func (*StringFormatRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure

Apply applies the rule to the given file.

func (*StringFormatRule) Name

func (*StringFormatRule) Name() string

Name returns the rule name.

func (StringFormatRule) ParseArgumentsTest

func (StringFormatRule) ParseArgumentsTest(arguments lint.Arguments) *string

ParseArgumentsTest is a public wrapper around w.parseArguments used for testing. Returns the error message provided to panic, or nil if no error was encountered

type StringOfIntRule

type StringOfIntRule struct{}

StringOfIntRule warns when logic expressions contains Boolean literals.

func (*StringOfIntRule) Apply

func (*StringOfIntRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*StringOfIntRule) Name

func (*StringOfIntRule) Name() string

Name returns the rule name.

type StructTagRule

type StructTagRule struct {
	sync.Mutex
	// contains filtered or unexported fields
}

StructTagRule lints struct tags.

func (*StructTagRule) Apply

func (r *StructTagRule) Apply(file *lint.File, args lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*StructTagRule) Name

func (*StructTagRule) Name() string

Name returns the rule name.

type SuperfluousElseRule

type SuperfluousElseRule struct{}

SuperfluousElseRule lints given else constructs.

func (*SuperfluousElseRule) Apply

func (e *SuperfluousElseRule) Apply(file *lint.File, args lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*SuperfluousElseRule) CheckIfElse added in v1.3.9

func (*SuperfluousElseRule) CheckIfElse(chain ifelse.Chain, args ifelse.Args) (failMsg string)

CheckIfElse evaluates the rule against an ifelse.Chain.

func (*SuperfluousElseRule) Name

func (*SuperfluousElseRule) Name() string

Name returns the rule name.

type TimeEqualRule

type TimeEqualRule struct{}

TimeEqualRule shows where "==" and "!=" used for equality check time.Time

func (*TimeEqualRule) Apply

func (*TimeEqualRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*TimeEqualRule) Name

func (*TimeEqualRule) Name() string

Name returns the rule name.

type TimeNamingRule

type TimeNamingRule struct{}

TimeNamingRule lints given else constructs.

func (*TimeNamingRule) Apply

func (*TimeNamingRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*TimeNamingRule) Name

func (*TimeNamingRule) Name() string

Name returns the rule name.

type UncheckedTypeAssertionRule added in v1.3.9

type UncheckedTypeAssertionRule struct {
	sync.Mutex
	// contains filtered or unexported fields
}

UncheckedTypeAssertionRule lints missing or ignored `ok`-value in danymic type casts.

func (*UncheckedTypeAssertionRule) Apply added in v1.3.9

func (u *UncheckedTypeAssertionRule) Apply(file *lint.File, args lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*UncheckedTypeAssertionRule) Name added in v1.3.9

Name returns the rule name.

type UnconditionalRecursionRule

type UnconditionalRecursionRule struct{}

UnconditionalRecursionRule lints given else constructs.

func (*UnconditionalRecursionRule) Apply

Apply applies the rule to given file.

func (*UnconditionalRecursionRule) Name

Name returns the rule name.

type UnexportedNamingRule

type UnexportedNamingRule struct{}

UnexportedNamingRule lints wrongly named unexported symbols.

func (*UnexportedNamingRule) Apply

Apply applies the rule to given file.

func (*UnexportedNamingRule) Name

func (*UnexportedNamingRule) Name() string

Name returns the rule name.

type UnexportedReturnRule

type UnexportedReturnRule struct{}

UnexportedReturnRule lints given else constructs.

func (*UnexportedReturnRule) Apply

Apply applies the rule to given file.

func (*UnexportedReturnRule) Name

func (*UnexportedReturnRule) Name() string

Name returns the rule name.

type UnhandledErrorRule

type UnhandledErrorRule struct {
	sync.Mutex
	// contains filtered or unexported fields
}

UnhandledErrorRule lints given else constructs.

func (*UnhandledErrorRule) Apply

func (r *UnhandledErrorRule) Apply(file *lint.File, args lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*UnhandledErrorRule) Name

func (*UnhandledErrorRule) Name() string

Name returns the rule name.

type UnnecessaryStmtRule

type UnnecessaryStmtRule struct{}

UnnecessaryStmtRule warns on unnecessary statements.

func (*UnnecessaryStmtRule) Apply

func (*UnnecessaryStmtRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*UnnecessaryStmtRule) Name

func (*UnnecessaryStmtRule) Name() string

Name returns the rule name.

type UnreachableCodeRule

type UnreachableCodeRule struct{}

UnreachableCodeRule lints unreachable code.

func (*UnreachableCodeRule) Apply

func (*UnreachableCodeRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*UnreachableCodeRule) Name

func (*UnreachableCodeRule) Name() string

Name returns the rule name.

type UnusedParamRule

type UnusedParamRule struct {
	sync.Mutex
	// contains filtered or unexported fields
}

UnusedParamRule lints unused params in functions.

func (*UnusedParamRule) Apply

func (r *UnusedParamRule) Apply(file *lint.File, args lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*UnusedParamRule) Name

func (*UnusedParamRule) Name() string

Name returns the rule name.

type UnusedReceiverRule

type UnusedReceiverRule struct {
	sync.Mutex
	// contains filtered or unexported fields
}

UnusedReceiverRule lints unused params in functions.

func (*UnusedReceiverRule) Apply

func (r *UnusedReceiverRule) Apply(file *lint.File, args lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*UnusedReceiverRule) Name

func (*UnusedReceiverRule) Name() string

Name returns the rule name.

type UseAnyRule

type UseAnyRule struct{}

UseAnyRule lints given else constructs.

func (*UseAnyRule) Apply

func (*UseAnyRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*UseAnyRule) Name

func (*UseAnyRule) Name() string

Name returns the rule name.

type UselessBreak

type UselessBreak struct{}

UselessBreak lint rule.

func (*UselessBreak) Apply

func (*UselessBreak) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*UselessBreak) Name

func (*UselessBreak) Name() string

Name returns the rule name.

type VarDeclarationsRule

type VarDeclarationsRule struct{}

VarDeclarationsRule lints given else constructs.

func (*VarDeclarationsRule) Apply

func (*VarDeclarationsRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*VarDeclarationsRule) Name

func (*VarDeclarationsRule) Name() string

Name returns the rule name.

type VarNamingRule

type VarNamingRule struct {
	sync.Mutex
	// contains filtered or unexported fields
}

VarNamingRule lints given else constructs.

func (*VarNamingRule) Apply

func (r *VarNamingRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*VarNamingRule) Name

func (*VarNamingRule) Name() string

Name returns the rule name.

type WaitGroupByValueRule

type WaitGroupByValueRule struct{}

WaitGroupByValueRule lints sync.WaitGroup passed by copy in functions.

func (*WaitGroupByValueRule) Apply

Apply applies the rule to given file.

func (*WaitGroupByValueRule) Name

func (*WaitGroupByValueRule) Name() string

Name returns the rule name.

Source Files

Jump to

Keyboard shortcuts

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