XS001

SchemasExtra · tfsproutx

check for map[string]*Schema that Description is configured

The XS001 analyzer reports cases of schemas where Description is not configured, which is generally useful for providers that wish to automatically generate documentation based on the schema information.

Examples

map[string]*schema.Schema{
    "attribute_name": {
        Optional: true,
        Type:     schema.TypeString,
    },
}
map[string]*schema.Schema{
    "attribute_name": {
        Description: "does something useful",
        Optional:    true,
        Type:        schema.TypeString,
    },
}

Ignoring reports

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

//lintignore:XS001
map[string]*schema.Schema{
    "attribute_name": {
        Optional: true,
        Type:     schema.TypeString,
    },
}

This page is generated from xpasses/XS001/README.md, which lives beside the analyzer.