rules

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MPL-2.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type BlockFormatConfig

type BlockFormatConfig struct {
	Format string `hclext:"format,optional"`
	Custom string `hclext:"custom,optional"`
}

BlockFormatConfig defines the pre-defined format or custom regular expression to use

type CustomFormatConfig

type CustomFormatConfig struct {
	Regexp      string `cty:"regex"`
	Description string `cty:"description"`
}

CustomFormatConfig defines a custom format that can be used instead of the predefined formats

type NameValidator

type NameValidator struct {
	Format        string
	IsNamedFormat bool
	Regexp        *regexp.Regexp
}

NameValidator contains the regular expression to validate block name, if it was a named format, and the format name/regular expression string

type TerraformCommentSyntaxRule

type TerraformCommentSyntaxRule struct {
	tflint.DefaultRule
}

TerraformCommentSyntaxRule checks whether comments use the preferred syntax

func NewTerraformCommentSyntaxRule

func NewTerraformCommentSyntaxRule() *TerraformCommentSyntaxRule

NewTerraformCommentSyntaxRule returns a new rule

func (*TerraformCommentSyntaxRule) Check

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

Check checks whether single line comments is used

func (*TerraformCommentSyntaxRule) Enabled

func (r *TerraformCommentSyntaxRule) Enabled() bool

Enabled returns whether the rule is enabled by default

Link returns the rule reference link

func (*TerraformCommentSyntaxRule) Name

Name returns the rule name

func (*TerraformCommentSyntaxRule) Severity

Severity returns the rule severity

type TerraformDeprecatedIndexRule

type TerraformDeprecatedIndexRule struct {
	tflint.DefaultRule
}

TerraformDeprecatedIndexRule warns about usage of the legacy dot syntax for indexes (foo.0)

func NewTerraformDeprecatedIndexRule

func NewTerraformDeprecatedIndexRule() *TerraformDeprecatedIndexRule

NewTerraformDeprecatedIndexRule return a new rule

func (*TerraformDeprecatedIndexRule) Check

Check walks all expressions and emit issues if deprecated index syntax is found

func (*TerraformDeprecatedIndexRule) Enabled

func (r *TerraformDeprecatedIndexRule) Enabled() bool

Enabled returns whether the rule is enabled by default

Link returns the rule reference link

func (*TerraformDeprecatedIndexRule) Name

Name returns the rule name

func (*TerraformDeprecatedIndexRule) Severity

Severity returns the rule severity

type TerraformDeprecatedInterpolationRule

type TerraformDeprecatedInterpolationRule struct {
	tflint.DefaultRule
}

TerraformDeprecatedInterpolationRule warns of deprecated interpolation in Terraform v0.11 or earlier.

func NewTerraformDeprecatedInterpolationRule

func NewTerraformDeprecatedInterpolationRule() *TerraformDeprecatedInterpolationRule

NewTerraformDeprecatedInterpolationRule return a new rule

func (*TerraformDeprecatedInterpolationRule) Check

Check emits issues on the deprecated interpolation syntax. This logic is equivalent to the warning logic implemented in Terraform. See https://github.com/hashicorp/terraform/pull/23348

func (*TerraformDeprecatedInterpolationRule) Enabled

Enabled returns whether the rule is enabled by default

Link returns the rule reference link

func (*TerraformDeprecatedInterpolationRule) Name

Name returns the rule name

func (*TerraformDeprecatedInterpolationRule) Severity

Severity returns the rule severity

type TerraformDeprecatedLookupRule added in v0.5.0

type TerraformDeprecatedLookupRule struct {
	tflint.DefaultRule
}

TerraformDeprecatedLookupRule warns about usage of the legacy dot syntax for indexes (foo.0)

func NewTerraformDeprecatedLookupRule added in v0.5.0

func NewTerraformDeprecatedLookupRule() *TerraformDeprecatedLookupRule

NewTerraformDeprecatedIndexRule return a new rule

func (*TerraformDeprecatedLookupRule) Check added in v0.5.0

Check walks all expressions and emit issues if deprecated index syntax is found

func (*TerraformDeprecatedLookupRule) Enabled added in v0.5.0

func (r *TerraformDeprecatedLookupRule) Enabled() bool

Enabled returns whether the rule is enabled by default

Link returns the rule reference link

func (*TerraformDeprecatedLookupRule) Name added in v0.5.0

Name returns the rule name

func (*TerraformDeprecatedLookupRule) Severity added in v0.5.0

Severity returns the rule severity

type TerraformDocumentedOutputsRule

type TerraformDocumentedOutputsRule struct {
	tflint.DefaultRule
}

TerraformDocumentedOutputsRule checks whether outputs have descriptions

func NewTerraformDocumentedOutputsRule

func NewTerraformDocumentedOutputsRule() *TerraformDocumentedOutputsRule

NewTerraformDocumentedOutputsRule returns a new rule

func (*TerraformDocumentedOutputsRule) Check

Check checks whether outputs have descriptions

func (*TerraformDocumentedOutputsRule) Enabled

func (r *TerraformDocumentedOutputsRule) Enabled() bool

Enabled returns whether the rule is enabled by default

Link returns the rule reference link

func (*TerraformDocumentedOutputsRule) Name

Name returns the rule name

func (*TerraformDocumentedOutputsRule) Severity

Severity returns the rule severity

type TerraformDocumentedVariablesRule

type TerraformDocumentedVariablesRule struct {
	tflint.DefaultRule
}

TerraformDocumentedVariablesRule checks whether variables have descriptions

func NewTerraformDocumentedVariablesRule

func NewTerraformDocumentedVariablesRule() *TerraformDocumentedVariablesRule

NewTerraformDocumentedVariablesRule returns a new rule

func (*TerraformDocumentedVariablesRule) Check

Check checks whether variables have descriptions

func (*TerraformDocumentedVariablesRule) Enabled

Enabled returns whether the rule is enabled by default

Link returns the rule reference link

func (*TerraformDocumentedVariablesRule) Name

Name returns the rule name

func (*TerraformDocumentedVariablesRule) Severity

Severity returns the rule severity

type TerraformEmptyListEqualityRule

type TerraformEmptyListEqualityRule struct {
	tflint.DefaultRule
}

TerraformEmptyListEqualityRule checks whether is there a comparison with an empty list

func NewTerraformEmptyListEqualityRule

func NewTerraformEmptyListEqualityRule() *TerraformEmptyListEqualityRule

NewTerraformCommentSyntaxRule returns a new rule

func (*TerraformEmptyListEqualityRule) Check

Check checks whether the list is being compared with static empty list

func (*TerraformEmptyListEqualityRule) Enabled

func (r *TerraformEmptyListEqualityRule) Enabled() bool

Enabled returns whether the rule is enabled by default

Link returns the rule reference link

func (*TerraformEmptyListEqualityRule) Name

Name returns the rule name

func (*TerraformEmptyListEqualityRule) Severity

Severity returns the rule severity

type TerraformModulePinnedSourceRule

type TerraformModulePinnedSourceRule struct {
	tflint.DefaultRule
	// contains filtered or unexported fields
}

TerraformModulePinnedSourceRule checks unpinned or default version module source

func NewTerraformModulePinnedSourceRule

func NewTerraformModulePinnedSourceRule() *TerraformModulePinnedSourceRule

NewTerraformModulePinnedSourceRule returns new rule with default attributes

func (*TerraformModulePinnedSourceRule) Check

Check checks if module source version is pinned Note that this rule is valid only for Git or Mercurial source

func (*TerraformModulePinnedSourceRule) Enabled

Enabled returns whether the rule is enabled by default

Link returns the rule reference link

func (*TerraformModulePinnedSourceRule) Name

Name returns the rule name

func (*TerraformModulePinnedSourceRule) Severity

Severity returns the rule severity

type TerraformModuleVersionRule

type TerraformModuleVersionRule struct {
	tflint.DefaultRule
}

TerraformModuleVersionRule checks that Terraform modules sourced from a registry specify a version

func NewTerraformModuleVersionRule

func NewTerraformModuleVersionRule() *TerraformModuleVersionRule

NewTerraformModuleVersionRule returns a new rule

func (*TerraformModuleVersionRule) Check

Check checks whether module source attributes resolve to a Terraform registry If they do, it checks a version (or range) is set

func (*TerraformModuleVersionRule) Enabled

func (r *TerraformModuleVersionRule) Enabled() bool

Enabled returns whether the rule is enabled by default

Link returns the rule reference link

func (*TerraformModuleVersionRule) Name

Name returns the rule name

func (*TerraformModuleVersionRule) Severity

Severity returns the rule severity

type TerraformModuleVersionRuleConfig

type TerraformModuleVersionRuleConfig struct {
	Exact bool `hclext:"exact,optional"`
}

TerraformModuleVersionRuleConfig is the config structure for the TerraformModuleVersionRule rule

type TerraformNamingConventionRule

type TerraformNamingConventionRule struct {
	tflint.DefaultRule
}

TerraformNamingConventionRule checks whether blocks follow naming convention

func NewTerraformNamingConventionRule

func NewTerraformNamingConventionRule() *TerraformNamingConventionRule

NewTerraformNamingConventionRule returns new rule with default attributes

func (*TerraformNamingConventionRule) Check

Check checks whether blocks follow naming convention

func (*TerraformNamingConventionRule) Enabled

func (r *TerraformNamingConventionRule) Enabled() bool

Enabled returns whether the rule is enabled by default

Link returns the rule reference link

func (*TerraformNamingConventionRule) Name

Name returns the rule name

func (*TerraformNamingConventionRule) Severity

Severity returns the rule severity

type TerraformRequiredProvidersRule

type TerraformRequiredProvidersRule struct {
	tflint.DefaultRule
}

TerraformRequiredProvidersRule checks whether Terraform sets version constraints for all configured providers

func NewTerraformRequiredProvidersRule

func NewTerraformRequiredProvidersRule() *TerraformRequiredProvidersRule

NewTerraformRequiredProvidersRule returns new rule with default attributes

func (*TerraformRequiredProvidersRule) Check

Check Checks whether provider required version is set

func (*TerraformRequiredProvidersRule) Enabled

func (r *TerraformRequiredProvidersRule) Enabled() bool

Enabled returns whether the rule is enabled by default

Link returns the rule reference link

func (*TerraformRequiredProvidersRule) Name

Name returns the rule name

func (*TerraformRequiredProvidersRule) Severity

Severity returns the rule severity

type TerraformRequiredVersionRule

type TerraformRequiredVersionRule struct {
	tflint.DefaultRule
}

TerraformRequiredVersionRule checks whether a terraform version has required_version attribute

func NewTerraformRequiredVersionRule

func NewTerraformRequiredVersionRule() *TerraformRequiredVersionRule

NewTerraformRequiredVersionRule returns new rule with default attributes

func (*TerraformRequiredVersionRule) Check

Check Checks whether required_version is set

func (*TerraformRequiredVersionRule) Enabled

func (r *TerraformRequiredVersionRule) Enabled() bool

Enabled returns whether the rule is enabled by default

Link returns the rule reference link

func (*TerraformRequiredVersionRule) Name

Name returns the rule name

func (*TerraformRequiredVersionRule) Severity

Severity returns the rule severity

type TerraformStandardModuleStructureRule

type TerraformStandardModuleStructureRule struct {
	tflint.DefaultRule
}

TerraformStandardModuleStructureRule checks whether modules adhere to Terraform's standard module structure

func NewTerraformStandardModuleStructureRule

func NewTerraformStandardModuleStructureRule() *TerraformStandardModuleStructureRule

NewTerraformStandardModuleStructureRule returns a new rule

func (*TerraformStandardModuleStructureRule) Check

Check emits errors for any missing files and any block types that are included in the wrong file

func (*TerraformStandardModuleStructureRule) Enabled

Enabled returns whether the rule is enabled by default

Link returns the rule reference link

func (*TerraformStandardModuleStructureRule) Name

Name returns the rule name

func (*TerraformStandardModuleStructureRule) Severity

Severity returns the rule severity

type TerraformTypedVariablesRule

type TerraformTypedVariablesRule struct {
	tflint.DefaultRule
}

TerraformTypedVariablesRule checks whether variables have a type declared

func NewTerraformTypedVariablesRule

func NewTerraformTypedVariablesRule() *TerraformTypedVariablesRule

NewTerraformTypedVariablesRule returns a new rule

func (*TerraformTypedVariablesRule) Check

Check checks whether variables have type

func (*TerraformTypedVariablesRule) Enabled

func (r *TerraformTypedVariablesRule) Enabled() bool

Enabled returns whether the rule is enabled by default

Link returns the rule reference link

func (*TerraformTypedVariablesRule) Name

Name returns the rule name

func (*TerraformTypedVariablesRule) Severity

Severity returns the rule severity

type TerraformUnusedDeclarationsRule

type TerraformUnusedDeclarationsRule struct {
	tflint.DefaultRule
}

TerraformUnusedDeclarationsRule checks whether variables, data sources, or locals are declared but unused

func NewTerraformUnusedDeclarationsRule

func NewTerraformUnusedDeclarationsRule() *TerraformUnusedDeclarationsRule

NewTerraformUnusedDeclarationsRule returns a new rule

func (*TerraformUnusedDeclarationsRule) Check

Check emits issues for any variables, locals, and data sources that are declared but not used

func (*TerraformUnusedDeclarationsRule) Enabled

Enabled returns whether the rule is enabled by default

Link returns the rule reference link

func (*TerraformUnusedDeclarationsRule) Name

Name returns the rule name

func (*TerraformUnusedDeclarationsRule) Severity

Severity returns the rule severity

type TerraformUnusedRequiredProvidersRule

type TerraformUnusedRequiredProvidersRule struct {
	tflint.DefaultRule
}

TerraformUnusedRequiredProvidersRule checks whether required providers are used in the module

func NewTerraformUnusedRequiredProvidersRule

func NewTerraformUnusedRequiredProvidersRule() *TerraformUnusedRequiredProvidersRule

NewTerraformUnusedRequiredProvidersRule returns new rule with default attributes

func (*TerraformUnusedRequiredProvidersRule) Check

Check checks whether required providers are used

func (*TerraformUnusedRequiredProvidersRule) Enabled

Enabled returns whether the rule is enabled by default

Link returns the rule reference link

func (*TerraformUnusedRequiredProvidersRule) Name

Name returns the rule name

func (*TerraformUnusedRequiredProvidersRule) Severity

Severity returns the rule severity

type TerraformWorkspaceRemoteRule

type TerraformWorkspaceRemoteRule struct {
	tflint.DefaultRule
}

TerraformWorkspaceRemoteRule warns of the use of terraform.workspace with a remote backend

func NewTerraformWorkspaceRemoteRule

func NewTerraformWorkspaceRemoteRule() *TerraformWorkspaceRemoteRule

NewTerraformWorkspaceRemoteRule return a new rule

func (*TerraformWorkspaceRemoteRule) Check

Check checks for a "remote" backend and if found emits issues for each use of terraform.workspace in an expression.

func (*TerraformWorkspaceRemoteRule) Enabled

func (r *TerraformWorkspaceRemoteRule) Enabled() bool

Enabled returns whether the rule is enabled by default

Link returns the rule reference link

func (*TerraformWorkspaceRemoteRule) Name

Name returns the rule name

func (*TerraformWorkspaceRemoteRule) Severity

Severity returns the rule severity

Jump to

Keyboard shortcuts

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