go-ruleguard: github.com/quasilyte/go-ruleguard/ruleguard Index | Files | Directories

package ruleguard

import "github.com/quasilyte/go-ruleguard/ruleguard"

Index

Package Files

bool3.go dsl_importer.go gorule.go merge.go node_category.go parser.go ruleguard.go runner.go utils.go

func RunRules Uses

func RunRules(ctx *Context, f *ast.File, rules *GoRuleSet) error

type Context Uses

type Context struct {
    Types  *types.Info
    Sizes  types.Sizes
    Fset   *token.FileSet
    Report func(rule GoRuleInfo, n ast.Node, msg string, s *Suggestion)
    Pkg    *types.Package
}

type GoRuleInfo Uses

type GoRuleInfo struct {
    // Filename is a file that defined this rule.
    Filename string
}

type GoRuleSet Uses

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

func MergeRuleSets Uses

func MergeRuleSets(toMerge []*GoRuleSet) *GoRuleSet

func ParseRules Uses

func ParseRules(filename string, fset *token.FileSet, r io.Reader) (*GoRuleSet, error)

type Suggestion Uses

type Suggestion struct {
    From        token.Pos
    To          token.Pos
    Replacement []byte
}

Directories

PathSynopsis
typematch

Package ruleguard imports 18 packages (graph) and is imported by 2 packages. Updated 2020-09-01. Refresh now. Tools for package owners.