Documentation ¶
Index ¶
- type DynamoDBExpressionRule
- func (r *DynamoDBExpressionRule) AddRules(visitorRules *pepperlint.Rules)
- func (r DynamoDBExpressionRule) CopyRule() pepperlint.Rule
- func (r DynamoDBExpressionRule) IsUsingExpression(obj object, elt ast.Expr) []ast.Expr
- func (r DynamoDBExpressionRule) UsingExpressionsPackage(expr ast.Expr) bool
- func (r DynamoDBExpressionRule) ValidateAssignStmt(stmt *ast.AssignStmt) error
- func (r *DynamoDBExpressionRule) ValidateFile(file *ast.File) error
- func (r *DynamoDBExpressionRule) WithCache(cache *pepperlint.Cache)
- func (r *DynamoDBExpressionRule) WithFileSet(fset *token.FileSet)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DynamoDBExpressionRule ¶
type DynamoDBExpressionRule struct {
// contains filtered or unexported fields
}
DynamoDBExpressionRule is a rule that validates whether or not an expressions package should have been used. Currently this will use the expressionFields cache to check whether or not it is usable by the expression package.
func NewDynamoDBExpressionRule ¶
func NewDynamoDBExpressionRule(fset *token.FileSet) *DynamoDBExpressionRule
NewDynamoDBExpressionRule returns a new rule with the given token.FileSet
func (*DynamoDBExpressionRule) AddRules ¶
func (r *DynamoDBExpressionRule) AddRules(visitorRules *pepperlint.Rules)
AddRules will add the DeprecatedFieldRule to the given visitor
func (DynamoDBExpressionRule) CopyRule ¶
func (r DynamoDBExpressionRule) CopyRule() pepperlint.Rule
CopyRule returns a new copy of the rule
func (DynamoDBExpressionRule) IsUsingExpression ¶
func (r DynamoDBExpressionRule) IsUsingExpression(obj object, elt ast.Expr) []ast.Expr
IsUsingExpression will return a list of expressions that are an dynamodb.Expression.
TODO: Figure out how to get field index TODO: This does not check whether or not typed aliased expression builders or if an expression string was returned by a function or method.
func (DynamoDBExpressionRule) UsingExpressionsPackage ¶
func (r DynamoDBExpressionRule) UsingExpressionsPackage(expr ast.Expr) bool
UsingExpressionsPackage checks to see if the expression package is being used.
func (DynamoDBExpressionRule) ValidateAssignStmt ¶
func (r DynamoDBExpressionRule) ValidateAssignStmt(stmt *ast.AssignStmt) error
ValidateAssignStmt will check if an assignment statement is using an expression builder compatible structure and field. If a field is being used, it will see if the expression builder is being used. If it is not, then an error will be returned
func (*DynamoDBExpressionRule) ValidateFile ¶
func (r *DynamoDBExpressionRule) ValidateFile(file *ast.File) error
ValidateFile will iterate through the import specs to determine whether or not dynamodb package is being used. This will also peel off the pkg name incase of package name overriding.
func (*DynamoDBExpressionRule) WithCache ¶
func (r *DynamoDBExpressionRule) 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 (*DynamoDBExpressionRule) WithFileSet ¶
func (r *DynamoDBExpressionRule) WithFileSet(fset *token.FileSet)
WithFileSet sets the rule's file set