Documentation ¶
Index ¶
- type FieldRule
- func (r *FieldRule) AddRules(visitorRules *pepperlint.Rules)
- func (r FieldRule) ValidateAssignStmt(stmt *ast.AssignStmt) error
- func (r FieldRule) ValidateBinaryExpr(expr *ast.BinaryExpr) error
- func (r FieldRule) ValidateCallExpr(expr *ast.CallExpr) error
- func (r FieldRule) ValidateIncDecStmt(stmt *ast.IncDecStmt) error
- func (r *FieldRule) ValidatePackage(pkg *ast.Package) error
- func (r FieldRule) ValidateRangeStmt(expr *ast.RangeStmt) error
- func (r FieldRule) ValidateReturnStmt(stmt *ast.ReturnStmt) error
- func (r *FieldRule) WithCache(cache *pepperlint.Cache)
- func (r *FieldRule) WithFileSet(fset *token.FileSet)
- type OpRule
- func (r *OpRule) AddRules(visitorRules *pepperlint.Rules)
- func (r *OpRule) ValidateAssignStmt(stmt *ast.AssignStmt) error
- func (r *OpRule) ValidateCallExpr(expr *ast.CallExpr) error
- func (r *OpRule) ValidatePackage(pkg *ast.Package) error
- func (r *OpRule) WithCache(cache *pepperlint.Cache)
- func (r *OpRule) WithFileSet(fset *token.FileSet)
- type Rule
- type StructRule
- func (r *StructRule) AddRules(visitorRules *pepperlint.Rules)
- func (r StructRule) ValidateAssignStmt(stmt *ast.AssignStmt) error
- func (r StructRule) ValidateBinaryExpr(expr *ast.BinaryExpr) error
- func (r StructRule) ValidateCallExpr(expr *ast.CallExpr) error
- func (r StructRule) ValidateFuncDecl(decl *ast.FuncDecl) error
- func (r *StructRule) ValidatePackage(pkg *ast.Package) error
- func (r StructRule) ValidateReturnStmt(stmt *ast.ReturnStmt) error
- func (r StructRule) ValidateTypeSpec(spec *ast.TypeSpec) error
- func (r StructRule) ValidateValueSpec(spec *ast.ValueSpec) error
- func (r *StructRule) WithCache(cache *pepperlint.Cache)
- func (r *StructRule) WithFileSet(fset *token.FileSet)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FieldRule ¶
type FieldRule struct {
// contains filtered or unexported fields
}
FieldRule will check usage of a deprecated field by field name.
func NewFieldRule ¶
NewFieldRule will return a new deprecation rule for fields. Any field is used that is marked with the deprecated comment will emit an error.
func (*FieldRule) AddRules ¶
func (r *FieldRule) AddRules(visitorRules *pepperlint.Rules)
AddRules will add the FieldRule to the given visitor
func (FieldRule) ValidateAssignStmt ¶
func (r FieldRule) ValidateAssignStmt(stmt *ast.AssignStmt) error
ValidateAssignStmt will check to see if a deprecated field is being set or used.
func (FieldRule) ValidateBinaryExpr ¶
func (r FieldRule) ValidateBinaryExpr(expr *ast.BinaryExpr) error
ValidateBinaryExpr will ensure that neither the LHS or RHS of the expr uses a deprecated field
func (FieldRule) ValidateCallExpr ¶
ValidateCallExpr will ensure that the deprecated field is not being passed as a parameter to a function or method.
func (FieldRule) ValidateIncDecStmt ¶
func (r FieldRule) ValidateIncDecStmt(stmt *ast.IncDecStmt) error
ValidateIncDecStmt will ensure that deprecated fields that utilize ++ or -- will return an error.
func (*FieldRule) ValidatePackage ¶
ValidatePackage will set the current package name to the package that is currently being visited.
func (FieldRule) ValidateRangeStmt ¶
ValidateRangeStmt will ensure that deprecated fields are not used within a range statement.
func (FieldRule) ValidateReturnStmt ¶
func (r FieldRule) ValidateReturnStmt(stmt *ast.ReturnStmt) error
ValidateReturnStmt will ensure that the deprecated field is not being returned by any method or function.
func (*FieldRule) WithCache ¶
func (r *FieldRule) WithCache(cache *pepperlint.Cache)
WithCache will create a new helper with the given cache. This is used to determine infomation about a specific ast.Node.
func (*FieldRule) WithFileSet ¶
WithFileSet will set the token.FileSet to the rule allowing for more in depth errors.
type OpRule ¶
type OpRule struct {
// contains filtered or unexported fields
}
OpRule is used to walk and determine if an operation, whether function or method, being used is deprecated. If it is a deprecated operation, the appropriate error will be returned.
func (*OpRule) AddRules ¶
func (r *OpRule) AddRules(visitorRules *pepperlint.Rules)
AddRules will add the DeprecatedFieldRule to the given visitor
func (*OpRule) ValidateAssignStmt ¶
func (r *OpRule) ValidateAssignStmt(stmt *ast.AssignStmt) error
ValidateAssignStmt will determine whether or not the RHS of an assignment expression contains any deprecated operation.
func (*OpRule) ValidateCallExpr ¶
ValidateCallExpr will determine if the operation in the CallExpr is deprecated.
func (*OpRule) ValidatePackage ¶
ValidatePackage is used to keep track of the current package scope that is being traversed.
func (*OpRule) WithCache ¶
func (r *OpRule) WithCache(cache *pepperlint.Cache)
WithCache will create a new helper with the given cache. This is used to determine infomation about a specific ast.Node.
func (*OpRule) WithFileSet ¶
WithFileSet will set the token.FileSet to the rule allowing for more in depth errors.
type Rule ¶
type Rule struct {
// contains filtered or unexported fields
}
Rule is a container for all deprecated rules
func (*Rule) AddRules ¶
func (r *Rule) AddRules(rules *pepperlint.Rules)
AddRules will add rules for every deprecate rule
func (Rule) CopyRule ¶
func (r Rule) CopyRule() pepperlint.Rule
CopyRule satisfies the copy ruler interface to copy the current Rule
func (*Rule) WithCache ¶
func (r *Rule) WithCache(cache *pepperlint.Cache)
WithCache will add rules for every deprecate rule
func (Rule) WithFileSet ¶
WithFileSet sets the file sets to each rule inside the deprecated rule container.
type StructRule ¶
type StructRule struct {
// contains filtered or unexported fields
}
StructRule will validate that no deprecated struct is used.
func NewStructRule ¶
func NewStructRule(fset *token.FileSet) *StructRule
NewStructRule return a newly instantiated StructRule with the given file set.
func (*StructRule) AddRules ¶
func (r *StructRule) AddRules(visitorRules *pepperlint.Rules)
AddRules will add the StructRule to the given visitor
func (StructRule) ValidateAssignStmt ¶
func (r StructRule) ValidateAssignStmt(stmt *ast.AssignStmt) error
ValidateAssignStmt will take a look to see if a deprecated structure is being assigned to a given variable.
func (StructRule) ValidateBinaryExpr ¶
func (r StructRule) ValidateBinaryExpr(expr *ast.BinaryExpr) error
ValidateBinaryExpr will ensure no deprecated struct is being used on either the LHS or RHS of the expression.
func (StructRule) ValidateCallExpr ¶
func (r StructRule) ValidateCallExpr(expr *ast.CallExpr) error
ValidateCallExpr will ensure a deprecated struct is not being passed as a parameter
func (StructRule) ValidateFuncDecl ¶
func (r StructRule) ValidateFuncDecl(decl *ast.FuncDecl) error
ValidateFuncDecl will validate function declaractions and ensure no deprecated structure is being used
func (*StructRule) ValidatePackage ¶
func (r *StructRule) ValidatePackage(pkg *ast.Package) error
ValidatePackage will set the current package name to the package that is currently being visited.
func (StructRule) ValidateReturnStmt ¶
func (r StructRule) ValidateReturnStmt(stmt *ast.ReturnStmt) error
ValidateReturnStmt will validate that return items are not deprecated structures.
func (StructRule) ValidateTypeSpec ¶
func (r StructRule) ValidateTypeSpec(spec *ast.TypeSpec) error
ValidateTypeSpec will ensure that the type spec's type isn't a deprecated structure.
func (StructRule) ValidateValueSpec ¶
func (r StructRule) ValidateValueSpec(spec *ast.ValueSpec) error
ValidateValueSpec will check structures used as values are not deprecated structs.
func (*StructRule) WithCache ¶
func (r *StructRule) WithCache(cache *pepperlint.Cache)
WithCache will create a new helper with the given cache. This is used to determine infomation about a specific ast.Node.
func (*StructRule) WithFileSet ¶
func (r *StructRule) WithFileSet(fset *token.FileSet)
WithFileSet will set the token.FileSet to the rule allowing for more in depth errors.