AT012

package
v0.28.1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2022 License: MPL-2.0 Imports: 8 Imported by: 2

README

AT012

The AT012 analyzer reports likely incorrect uses of multiple TestAcc function name prefixes up to the conventional underscore (_) prefix separator within the same file. Typically, Terraform acceptance tests should use the same naming prefix within one test file so testers can easily run all acceptance tests for the file and not miss associated tests.

Optional parameters:

  • ignored-filenames Comma-separated list of file names to ignore, defaults to none.

Flagged Code

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

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

Passing Code

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

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

Ignoring Reports

In addition to the optional parameters, reports can be ignored by adding a //lintignore:AT012 Go code comment before any test declaration to ignore, e.g.

//lintignore:AT012
func TestAccExampleThing1_Test(t *testing.T) { /* ... */ }

//lintignore:AT012
func TestAccExampleThing2_Test(t *testing.T) { /* ... */ }

If a file mainly uses one prefix, the code ignores can be simplified to only the non-conforming test declarations.

Documentation

Index

Constants

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

Variables

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