AT003

package
v1.0.2 Latest Latest
Warning

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

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

README

AT003

The AT003 analyzer reports where an underscore is not present in the function name, which could make per-resource testing harder to execute in larger providers or those with overlapping resource names.

Flagged Code

This example is presuming there are two separate resources:

  • example_thing
  • example_thing_association
func TestAccExampleThing(t *testing.T) { /* ... */ }

func TestAccExampleThingSomeAttribute(t *testing.T) { /* ... */ }

func TestAccExampleThingAssociation(t *testing.T) { /* ... */ }

func TestAccExampleThingAssociationSomeAttribute(t *testing.T) { /* ... */ }

Passing Code

func TestAccExampleThing_basic(t *testing.T) { /* ... */ }

func TestAccExampleThing_SomeAttribute(t *testing.T) { /* ... */ }

func TestAccExampleThingAssociation_basic(t *testing.T) { /* ... */ }

func TestAccExampleThingAssociation_SomeAttribute(t *testing.T) { /* ... */ }

Ignoring Reports

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

//lintignore:AT003
func TestAccExampleThing(t *testing.T) { /* ... */ }

Documentation

Overview

Package AT003 defines an Analyzer that checks for acceptance test names missing an underscore

Index

Constants

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

Variables

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