Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Preset string `hclext:"preset,optional"`
}
Config is the configuration for the ruleset.
type Local ¶
type Local struct { Name string Attribute *hcl.Attribute DefRange hcl.Range }
Local represents a single entry from a "locals" block.
type ModuleCall ¶
type ModuleCall struct { Name string DefRange hcl.Range Source string SourceAttr *hclext.Attribute Version version.Constraints VersionAttr *hclext.Attribute }
ModuleCall represents a "module" block.
type ProviderRef ¶
type ProviderRef struct { Name string DefRange hcl.Range }
ProviderRef represents a reference to a provider like `provider = google.europe` in a resource or module.
type RuleSet ¶
type RuleSet struct { tflint.BuiltinRuleSet PresetRules map[string][]tflint.Rule // contains filtered or unexported fields }
RuleSet is the custom ruleset for the Terraform Language.
func (*RuleSet) ApplyConfig ¶
func (r *RuleSet) ApplyConfig(body *hclext.BodyContent) error
ApplyConfig controls rule activation based on global and preset configs. The priority of rules is in the following order:
- --only option
- Rule config declared in each "rule" block
- Preset config declared in "plugin" block
- The `disabled_by_default` declared in global "config" block
Individual rule configs always take precedence over anything else. Preset rules are then prioritized. For example, if `disabled_by_default = true` and `preset = "recommended"` is declared, all recommended rules will be enabled.
func (*RuleSet) ApplyGlobalConfig ¶
ApplyGlobalConfig is normally not expected to be overridden, but here the preset setting takes precedence over DisabledByDefault, so it just overrides and saves the global config to the ruleset.
func (*RuleSet) ConfigSchema ¶
func (r *RuleSet) ConfigSchema() *hclext.BodySchema
type Runner ¶
Runner is a custom runner that provides helper functions for this ruleset.
func (*Runner) GetModuleCalls ¶
func (r *Runner) GetModuleCalls() ([]*ModuleCall, hcl.Diagnostics)
GetModuleCalls returns all "module" blocks, including uncreated module calls.
func (*Runner) GetProviderRefs ¶
func (r *Runner) GetProviderRefs() (map[string]*ProviderRef, hcl.Diagnostics)
GetProviderRefs returns all references to providers in resources, data, provider declarations, module calls, and provider-defined functinos.