AWSR002

package
v0.0.0-...-724c62b Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2022 License: MPL-2.0 Imports: 6 Imported by: 0

README

AWSR002

The AWSR002 analyzer reports when a (schema.ResourceData).Set() call with the tags key is missing a call to (keyvaluetags.KeyValueTags).IgnoreConfig() in the value, which ensures any provider level ignore tags configuration is applied.

Flagged Code

d.Set("tags", keyvaluetags.Ec2KeyValueTags(subnet.Tags).IgnoreAws().Map())

Passing Code

ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig

d.Set("tags", keyvaluetags.Ec2KeyValueTags(subnet.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map())

Ignoring Check

The check can be ignored for a certain line via a //lintignore:AWSR002 comment on the previous line or at the end of the offending line, e.g.

//lintignore:AWSR002
d.Set("tags", keyvaluetags.Ec2KeyValueTags(subnet.Tags).IgnoreAws().Map())

Documentation

Index

Constants

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

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name: analyzerName,
	Doc:  Doc,
	Requires: []*analysis.Analyzer{
		commentignore.Analyzer,
		resourcedatasetcallexpr.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