rules

package
v0.0.0-...-bd26d79 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: MIT Imports: 1 Imported by: 2

Documentation

Overview

Package rules contains specific rules as subpackages to check a Makefile against

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRule

func RegisterRule(r Rule)

RegisterRule let's you register a rule for inclusion in the validator

Types

type Rule

type Rule interface {
	Name() string
	Description() string
	Run(parser.Makefile, RuleConfig) RuleViolationList
}

Rule is the type of a rule function

type RuleConfig

type RuleConfig map[string]string

RuleConfig is a simple string/string map to hold key/value configuration for rules.

type RuleConfigMap

type RuleConfigMap map[string]RuleConfig

RuleConfigMap is a map that stores RuleConfig maps keyed by the rule name

type RuleRegistry

type RuleRegistry map[string]Rule

RuleRegistry is the type to hold rules keyed by their name

func GetRegisteredRules

func GetRegisteredRules() RuleRegistry

GetRegisteredRules returns the internal ruleRegistry

type RuleViolation

type RuleViolation struct {
	Rule       string
	Violation  string
	FileName   string
	LineNumber int
}

RuleViolation represents a basic validation failure

type RuleViolationList

type RuleViolationList []RuleViolation

RuleViolationList is a list of Violation types and the return type of a Rule function

Directories

Path Synopsis
Package maxbodylength implements the ruleset for making sure target bodies are kept short and thus hopefully somewhat not complex.
Package maxbodylength implements the ruleset for making sure target bodies are kept short and thus hopefully somewhat not complex.
Package minphony implements the ruleset for making sure required minimum phony targets are present
Package minphony implements the ruleset for making sure required minimum phony targets are present
Package phonydeclared implements the ruleset for making sure all targets that don't have a rule body are marked PHONY
Package phonydeclared implements the ruleset for making sure all targets that don't have a rule body are marked PHONY
Package timestampexpanded implements the ruleset for making sure a variable that likely represents a timestamp is simply expanded so it doesn't change in between rule executions.
Package timestampexpanded implements the ruleset for making sure a variable that likely represents a timestamp is simply expanded so it doesn't change in between rule executions.

Jump to

Keyboard shortcuts

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