Skip to content

Latest commit

 

History

History
 
 

S014

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

S014

The S014 analyzer reports cases of schemas which the Elem has Computed, Optional, or Required configured, which will fail provider schema validation.

Flagged Code

map[string]*schema.Schema{
    "attribute_name": {
        Elem:     &schema.Schema{
            Required: true,
            Type:     schema.TypeString,
        },
        Required: true,
        Type:     schema.TypeList,
    },
}

Passing Code

map[string]*schema.Schema{
    "attribute_name": {
        Elem:     &schema.Schema{
            Type: schema.TypeString,
        },
        Required: true,
        Type:     schema.TypeList,
    },
}

Ignoring Reports

Singular reports can be ignored by adding the a //lintignore:S014 Go code comment at the end of the offending line or on the line immediately proceding, e.g.

//lintignore:S014
map[string]*schema.Schema{
    "attribute_name": {
        Elem:     &schema.Schema{
            Required: true,
            Type:     schema.TypeString,
        },
        Required: true,
        Type:     schema.TypeList,
    },
}