rule

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterRules added in v0.3.0

func FilterRules(ruleIDs []string, filter *TargetFilter) []string

func Register

func Register(r Rule)

Types

type Applicability

type Applicability struct {
	Platform  binary.Platform
	Compilers map[toolchain.Compiler]CompilerRequirement
}

type CompilerRequirement

type CompilerRequirement struct {
	MinVersion     toolchain.Version
	DefaultVersion toolchain.Version
	Flag           string
}

type CompilerTarget added in v0.3.0

type CompilerTarget struct {
	Compiler   toolchain.Compiler
	MaxVersion *toolchain.Version
}

func ParseCompilerTarget added in v0.3.0

func ParseCompilerTarget(s string) (CompilerTarget, error)

type ELFRule

type ELFRule interface {
	Rule
	Execute(bin *binary.ELFBinary) ExecuteResult
}

type ExecuteResult

type ExecuteResult struct {
	Status  Status
	Message string
}

type PlatformTarget added in v0.3.0

type PlatformTarget struct {
	Architecture binary.Architecture
	MaxISA       *binary.ISA
}

func ParsePlatformTarget added in v0.3.0

func ParsePlatformTarget(s string) (PlatformTarget, error)

type ProcessedResult

type ProcessedResult struct {
	ExecuteResult
	RuleID     string
	Name       string
	Suggestion string
}

type Rule

type Rule interface {
	ID() string
	Name() string
	Description() string
	Applicability() Applicability
}

func Get

func Get(id string) Rule

func GetAll added in v0.2.1

func GetAll() []Rule

type Status

type Status int
const (
	StatusPassed Status = iota
	StatusFailed
	StatusSkipped
)

func (Status) String

func (s Status) String() string

type TargetFilter added in v0.3.0

type TargetFilter struct {
	Platforms []PlatformTarget
	Compilers []CompilerTarget
}

func ParseTargetFilter added in v0.3.0

func ParseTargetFilter(platforms, compilers string) (*TargetFilter, error)

func (*TargetFilter) IsEmpty added in v0.3.0

func (f *TargetFilter) IsEmpty() bool

func (*TargetFilter) Matches added in v0.3.0

func (f *TargetFilter) Matches(app Applicability) bool

Jump to

Keyboard shortcuts

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