Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConfigurationLayer ¶
type ConfigurationLayer struct { Files map[string]FileConfig `yaml:"files"` EnsureTerraformVersion bool `yaml:"ensure_terraform_version"` EnsureProvidersVersion bool `yaml:"ensure_providers_version"` EnsureVariablesDescrition bool `yaml:"ensure_variables_description"` EnsureOutputsDescrition bool `yaml:"ensure_outputs_description"` BlockPatternName string `yaml:"block_pattern_name"` }
ConfigurationLayer is a type that define a layer of config for a folder.
func DefaultConfigurationLayer ¶
func DefaultConfigurationLayer() ConfigurationLayer
DefaultConfigurationLayer return you the default ConfigurationLayer
func (ConfigurationLayer) GetAuthorizedBlocks ¶
func (configLayer ConfigurationLayer) GetAuthorizedBlocks(filename string) ([]string, error)
GetAuthorizedBlocks gets you the authorized blocks for the given filename. If the filename is not configure it gets you the dfault configuration. If their is no default either, return you an error.
func (ConfigurationLayer) GetMandatoryFiles ¶
func (configLayer ConfigurationLayer) GetMandatoryFiles() []string
GetMandatoryFiles get the mandatory file list from the globalConfig
type FileConfig ¶
type FileConfig struct { AuthorizedBlocks []string `yaml:"authorized_blocks"` Mandatory bool `yaml:"mandatory"` }
FileConfig is the configuration for a .tf file AuthorizedBlocks is the list of authorized blocks in that file (for example "variables", "output"...). Mandatory is a boolean that define if the file is mandatory or not.
type TfvConfig ¶
type TfvConfig struct { CurrentLayer string Layers map[string]ConfigurationLayer }
TfvConfig is the full configuration of terraform validator CurrentLayer is the current folder applied layer Layers is a map of ConfigurationLayer
func DefaultTfvConfig ¶
func DefaultTfvConfig() TfvConfig
DefaultTfvConfig returns you the default TfvConfig
func (TfvConfig) GetConfigurationLayer ¶
func (c TfvConfig) GetConfigurationLayer() ConfigurationLayer
GetConfigurationLayer get the applied ConfigurationLayer
func (TfvConfig) GetTerraformConfig ¶
GetTerraformConfig get the terraform-validator config. If .terraform-validator.yaml exists it merge the default and the custom config
func (*TfvConfig) UnmarshalYAML ¶
UnmarshalYAML is a custom yaml unmarshaller for TerraformConfig