rule

package
v0.0.0-...-aa96070 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddConstantRule

type AddConstantRule struct{}

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 (r *AddConstantRule) Name() string

Name returns the rule name.

type ArgumentsLimitRule

type ArgumentsLimitRule struct{}

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 (r *ArgumentsLimitRule) 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, arguments lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*BlankImportsRule) Name

func (r *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 (r *BoolLiteralRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*BoolLiteralRule) Name

func (r *BoolLiteralRule) 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 (r *ConfusingNamingRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*ConfusingNamingRule) Name

func (r *ConfusingNamingRule) Name() string

Name returns the rule name.

type ConfusingResultsRule

type ConfusingResultsRule struct{}

ConfusingResultsRule lints given function declarations

func (*ConfusingResultsRule) Apply

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

Apply applies the rule to given file.

func (*ConfusingResultsRule) Name

func (r *ConfusingResultsRule) Name() string

Name returns the rule name.

type ConstantLogicalExprRule

type ConstantLogicalExprRule struct{}

ConstantLogicalExprRule warns on constant logical expressions.

func (*ConstantLogicalExprRule) Apply

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

Apply applies the rule to given file.

func (*ConstantLogicalExprRule) Name

func (r *ConstantLogicalExprRule) Name() string

Name returns the rule name.

type ContextAsArgumentRule

type ContextAsArgumentRule struct{}

ContextAsArgumentRule lints given else constructs.

func (*ContextAsArgumentRule) Apply

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

Apply applies the rule to given file.

func (*ContextAsArgumentRule) Name

func (r *ContextAsArgumentRule) Name() string

Name returns the rule name.

type ContextKeysType

type ContextKeysType struct{}

ContextKeysType lints given else constructs.

func (*ContextKeysType) Apply

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

Apply applies the rule to given file.

func (*ContextKeysType) Name

func (r *ContextKeysType) Name() string

Name returns the rule name.

type CyclomaticRule

type CyclomaticRule struct{}

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 (r *CyclomaticRule) 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 (r *DeepExitRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*DeepExitRule) Name

func (r *DeepExitRule) Name() string

Name returns the rule name.

type DotImportsRule

type DotImportsRule struct{}

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 (r *DotImportsRule) Name() string

Name returns the rule name.

type EmptyBlockRule

type EmptyBlockRule struct{}

EmptyBlockRule lints given else constructs.

func (*EmptyBlockRule) Apply

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

Apply applies the rule to given file.

func (*EmptyBlockRule) Name

func (r *EmptyBlockRule) Name() string

Name returns the rule name.

type ErrorNamingRule

type ErrorNamingRule struct{}

ErrorNamingRule lints given else constructs.

func (*ErrorNamingRule) Apply

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

Apply applies the rule to given file.

func (*ErrorNamingRule) Name

func (r *ErrorNamingRule) Name() string

Name returns the rule name.

type ErrorReturnRule

type ErrorReturnRule struct{}

ErrorReturnRule lints given else constructs.

func (*ErrorReturnRule) Apply

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

Apply applies the rule to given file.

func (*ErrorReturnRule) Name

func (r *ErrorReturnRule) Name() string

Name returns the rule name.

type ErrorStringsRule

type ErrorStringsRule struct{}

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 (r *ErrorStringsRule) Name() string

Name returns the rule name.

type ErrorfRule

type ErrorfRule struct{}

ErrorfRule lints given else constructs.

func (*ErrorfRule) Apply

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

Apply applies the rule to given file.

func (*ErrorfRule) Name

func (r *ErrorfRule) Name() string

Name returns the rule name.

type ExportedRule

type ExportedRule struct{}

ExportedRule lints given else constructs.

func (*ExportedRule) Apply

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

Apply applies the rule to given file.

func (*ExportedRule) Name

func (r *ExportedRule) Name() string

Name returns the rule name.

type FileHeaderRule

type FileHeaderRule struct{}

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 (r *FileHeaderRule) Name() string

Name returns the rule name.

type FlagParamRule

type FlagParamRule struct{}

FlagParamRule lints given else constructs.

func (*FlagParamRule) Apply

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

Apply applies the rule to given file.

func (*FlagParamRule) Name

func (r *FlagParamRule) Name() string

Name returns the rule name.

type GetReturnRule

type GetReturnRule struct{}

GetReturnRule lints given else constructs.

func (*GetReturnRule) Apply

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

Apply applies the rule to given file.

func (*GetReturnRule) Name

func (r *GetReturnRule) Name() string

Name returns the rule name.

type IfReturnRule

type IfReturnRule struct{}

IfReturnRule lints given else constructs.

func (*IfReturnRule) Apply

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

Apply applies the rule to given file.

func (*IfReturnRule) Name

func (r *IfReturnRule) Name() string

Name returns the rule name.

type IncrementDecrementRule

type IncrementDecrementRule struct{}

IncrementDecrementRule lints given else constructs.

func (*IncrementDecrementRule) Apply

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

Apply applies the rule to given file.

func (*IncrementDecrementRule) Name

func (r *IncrementDecrementRule) Name() string

Name returns the rule name.

type IndentErrorFlowRule

type IndentErrorFlowRule struct{}

IndentErrorFlowRule lints given else constructs.

func (*IndentErrorFlowRule) Apply

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

Apply applies the rule to given file.

func (*IndentErrorFlowRule) Name

func (r *IndentErrorFlowRule) Name() string

Name returns the rule name.

type MaxPublicStructsRule

type MaxPublicStructsRule struct{}

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 (r *MaxPublicStructsRule) Name() string

Name returns the rule name.

type ModifiesParamRule

type ModifiesParamRule struct{}

ModifiesParamRule lints given else constructs.

func (*ModifiesParamRule) Apply

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

Apply applies the rule to given file.

func (*ModifiesParamRule) Name

func (r *ModifiesParamRule) Name() string

Name returns the rule name.

type ModifiesValRecRule

type ModifiesValRecRule struct{}

ModifiesValRecRule lints assignments to value method-receivers.

func (*ModifiesValRecRule) Apply

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

Apply applies the rule to given file.

func (*ModifiesValRecRule) Name

func (r *ModifiesValRecRule) Name() string

Name returns the rule name.

type PackageCommentsRule

type PackageCommentsRule struct{}

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, arguments lint.Arguments) []lint.Failure

Apply applies the rule to given file.

func (*PackageCommentsRule) Name

func (r *PackageCommentsRule) Name() string

Name returns the rule name.

type RangeRule

type RangeRule struct{}

RangeRule lints given else constructs.

func (*RangeRule) Apply

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

Apply applies the rule to given file.

func (*RangeRule) Name

func (r *RangeRule) Name() string

Name returns the rule name.

type ReceiverNamingRule

type ReceiverNamingRule struct{}

ReceiverNamingRule lints given else constructs.

func (*ReceiverNamingRule) Apply

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

Apply applies the rule to given file.

func (*ReceiverNamingRule) Name

func (r *ReceiverNamingRule) Name() string

Name returns the rule name.

type StructTagRule

type StructTagRule struct{}

StructTagRule lints struct tags.

func (*StructTagRule) Apply

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

Apply applies the rule to given file.

func (*StructTagRule) Name

func (r *StructTagRule) Name() string

Name returns the rule name.

type SuperfluousElseRule

type SuperfluousElseRule struct{}

SuperfluousElseRule lints given else constructs.

func (*SuperfluousElseRule) Apply

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

Apply applies the rule to given file.

func (*SuperfluousElseRule) Name

func (r *SuperfluousElseRule) Name() string

Name returns the rule name.

type TimeNamingRule

type TimeNamingRule struct{}

TimeNamingRule lints given else constructs.

func (*TimeNamingRule) Apply

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

Apply applies the rule to given file.

func (*TimeNamingRule) Name

func (r *TimeNamingRule) Name() string

Name returns the rule name.

type UnexportedReturnRule

type UnexportedReturnRule struct{}

UnexportedReturnRule lints given else constructs.

func (*UnexportedReturnRule) Apply

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

Apply applies the rule to given file.

func (*UnexportedReturnRule) Name

func (r *UnexportedReturnRule) Name() string

Name returns the rule name.

type UnnecessaryStmtRule

type UnnecessaryStmtRule struct{}

UnnecessaryStmtRule warns on unnecessary statements.

func (*UnnecessaryStmtRule) Apply

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

Apply applies the rule to given file.

func (*UnnecessaryStmtRule) Name

func (r *UnnecessaryStmtRule) Name() string

Name returns the rule name.

type UnreachableCodeRule

type UnreachableCodeRule struct{}

UnreachableCodeRule lints unreachable code.

func (*UnreachableCodeRule) Apply

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

Apply applies the rule to given file.

func (*UnreachableCodeRule) Name

func (r *UnreachableCodeRule) Name() string

Name returns the rule name.

type UnusedParamRule

type UnusedParamRule struct{}

UnusedParamRule lints unused params in functions.

func (*UnusedParamRule) Apply

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

Apply applies the rule to given file.

func (*UnusedParamRule) Name

func (r *UnusedParamRule) Name() string

Name returns the rule name.

type VarDeclarationsRule

type VarDeclarationsRule struct{}

VarDeclarationsRule lints given else constructs.

func (*VarDeclarationsRule) Apply

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

Apply applies the rule to given file.

func (*VarDeclarationsRule) Name

func (r *VarDeclarationsRule) Name() string

Name returns the rule name.

type VarNamingRule

type VarNamingRule struct{}

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 (r *VarNamingRule) Name() string

Name returns the rule name.

Jump to

Keyboard shortcuts

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