S014

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: MPL-2.0 Imports: 6 Imported by: 2

README

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,
    },
}

Documentation

Overview

Package S014 defines an Analyzer that checks for Schema that within Elem, Computed, Optional, and Required are not configured

Index

Constants

View Source
const Doc = `` /* 226-byte string literal not displayed */

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name: analyzerName,
	Doc:  Doc,
	Requires: []*analysis.Analyzer{
		schemamapcompositelit.Analyzer,
		commentignore.Analyzer,
	},
	Run: run,
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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