R019

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: 5 Imported by: 2

README

R019

The R019 analyzer reports when there are a large number of arguments being passed to (*schema.ResourceData).HasChanges(), which it may be preferable to use (*schema.ResourceData).HasChangesExcept() instead.

Optional Arguments

  • -threshold=5 Number of arguments before reporting

Flagged Code

d.HasChanges("attr1", "attr2", "attr3", "attr4", "attr5")

Passing Code

d.HasChangesExcept("metadata_attr")

Ignoring Reports

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

//lintignore:R019
d.HasChanges("attr1", "attr2", "attr3", "attr4", "attr5")

Documentation

Index

Constants

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

Variables

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