rules

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2025 License: MPL-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

Functions

func AssertIssues

func AssertIssues(t *testing.T, expected helper.Issues, actual helper.Issues)

AssertIssues is an assertion helper for comparing issues.

func Check

func Check(runner tflint.Runner, check func(tflint.Runner, *hcl.File) error) error

Check checks whether the tf config files match given rules

func IsHeadMeta

func IsHeadMeta(argName string) bool

IsHeadMeta checks whether a name represents a type of head Meta arg

func IsTailMeta

func IsTailMeta(argName string) bool

IsTailMeta checks whether a name represents a type of tail Meta arg

Types

type Arg

type Arg struct {
	Name  string
	Range hcl.Range
	File  *hcl.File
}

Arg is a wrapper of the attribute

func (*Arg) ToString

func (a *Arg) ToString() string

ToString prints the arg content

type Args

type Args struct {
	Args  []*Arg
	Range *hcl.Range
}

Args is the collection of args with the same type

func (*Args) CheckOrder

func (a *Args) CheckOrder() bool

CheckOrder checks whether this type of args are sorted

func (*Args) GetRange

func (a *Args) GetRange() *hcl.Range

GetRange returns the entire range of this type of args

func (*Args) ToString

func (a *Args) ToString() string

ToString prints this type of args in order

type AzurermArgOrderRule

type AzurermArgOrderRule struct {
	tflint.DefaultRule
}

AzurermArgOrderRule checks whether the arguments in a block are sorted in azure doc order

func NewAzurermArgOrderRule

func NewAzurermArgOrderRule() *AzurermArgOrderRule

NewAzurermArgOrderRule returns a new rule

func (*AzurermArgOrderRule) Check

func (r *AzurermArgOrderRule) Check(runner tflint.Runner) error

func (*AzurermArgOrderRule) CheckFile

func (r *AzurermArgOrderRule) CheckFile(runner tflint.Runner, file *hcl.File) error

CheckFile checks whether the arguments in a block are sorted in codex order

func (*AzurermArgOrderRule) Enabled

func (r *AzurermArgOrderRule) Enabled() bool
func (r *AzurermArgOrderRule) Link() string

func (*AzurermArgOrderRule) Name

func (r *AzurermArgOrderRule) Name() string

Name returns the rule name

func (*AzurermArgOrderRule) Severity

func (r *AzurermArgOrderRule) Severity() tflint.Severity

type