Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BlockChecker ¶
type BlockChecker struct { linter.BlockCheckerDefaults // contains filtered or unexported fields }
BlockChecker is a walker that handles function calls, method calls, class creation, and file imports in block context (inside functions).
func NewBlockChecker ¶
func NewBlockChecker(ctx *linter.BlockContext, root *RootChecker) *BlockChecker
NewBlockChecker creates a new BlockChecker walker.
func (*BlockChecker) AfterEnterNode ¶ added in v1.0.2
func (b *BlockChecker) AfterEnterNode(n ir.Node)
AfterEnterNode is the main method for processing AST nodes.
func (*BlockChecker) EnterNode ¶
func (b *BlockChecker) EnterNode(n ir.Node) bool
EnterNode is method to use BlockChecker in the Walk method of AST nodes.
func (*BlockChecker) LeaveNode ¶
func (b *BlockChecker) LeaveNode(n ir.Node)
LeaveNode is method to use BlockChecker in the Walk method of AST nodes.
type BlockIndexer ¶
type BlockIndexer struct {
linter.BlockCheckerDefaults
}
BlockIndexer is a dummy walker.
type FileMeta ¶
FileMeta describes the data to be cached.
func NewFileMeta ¶
func NewFileMeta() FileMeta
NewFileMeta returns a new FileMeta instance with pre-allocated fields.
type GlobalContext ¶
GlobalContext is a structure for storing cache.
func NewGlobalContext ¶
func NewGlobalContext(info *meta.Info) *GlobalContext
NewGlobalContext creates a new context.
func (*GlobalContext) Decode ¶
func (ctx *GlobalContext) Decode(r io.Reader, filename string) error
Decode recovers data from cache.
func (*GlobalContext) Encode ¶
func (ctx *GlobalContext) Encode(writer io.Writer, checker linter.RootChecker) error
Encode caches the data of one rootWalker of one file.
func (*GlobalContext) UpdateMeta ¶
func (ctx *GlobalContext) UpdateMeta(f *FileMeta, filename string)
UpdateMeta recovers data by collecting it from each file.
func (*GlobalContext) Version ¶
func (ctx *GlobalContext) Version() string
Version returns the current version of the cache.
type RootChecker ¶
type RootChecker struct { linter.RootCheckerDefaults // contains filtered or unexported fields }
RootChecker is a walker that collects information about the colors of functions and checks them for correctness.
func NewRootChecker ¶
func NewRootChecker(palette *palette.Palette, globalCtx *GlobalContext, ctx *linter.RootContext, colorTag string) *RootChecker
NewRootChecker returns a new walker.
func (*RootChecker) BeforeEnterFile ¶
func (r *RootChecker) BeforeEnterFile()
BeforeEnterFile sets the current function of the file.
func (*RootChecker) EnterNode ¶
func (r *RootChecker) EnterNode(n ir.Node) bool
EnterNode is method to use RootChecker in the Walk method of AST nodes.
func (*RootChecker) LeaveNode ¶
func (r *RootChecker) LeaveNode(ir.Node)
LeaveNode is method to use RootChecker in the Walk method of AST nodes.
type RootIndexer ¶
type RootIndexer struct { linter.RootCheckerDefaults // contains filtered or unexported fields }
RootIndexer is a walker that collects information about function definitions, as well as about the files where they are defined.
func NewRootIndexer ¶
func NewRootIndexer(pal *palette.Palette, globalCtx *GlobalContext, ctx *linter.RootContext, colorTag string) *RootIndexer
NewRootIndexer creates a new walker.
func (*RootIndexer) AfterLeaveFile ¶
func (r *RootIndexer) AfterLeaveFile()
AfterLeaveFile updates the cache.
func (*RootIndexer) BeforeEnterFile ¶
func (r *RootIndexer) BeforeEnterFile()
BeforeEnterFile processes all files, creating a new function for each with an autogenerated name.
func (*RootIndexer) BeforeEnterNode ¶
func (r *RootIndexer) BeforeEnterNode(n ir.Node)
BeforeEnterNode collects information about functions and methods.
func (*RootIndexer) BeforeLeaveNode ¶ added in v1.0.1
func (r *RootIndexer) BeforeLeaveNode(n ir.Node)
BeforeLeaveNode collects information about functions and methods.