testnamestyle

package module
v0.0.0-...-55b6d25 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: MPL-2.0 Imports: 9 Imported by: 0

README

Go test naming convention linter

go install github.com/devnev/testnamestyle/cmd/go-testnamestyle
go-testnamestyle -rule 'Test(?:[^_]+)?(?:_[a-z][^_]*)?' all
  • no rules are configured by default
  • -rule may be specified multiple times to add further rules
  • if any rule matches, the test name is accepted
  • rules are regexp patterns and must match the entire test name
  • for rules with one capture group, the captured string must match a struct type or function declaration in the package
  • for rules with two capture groups, the first captured string must match a struct type declaration in the package, and the second captured string must match a method of that type

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TestFuncs = &analysis.Analyzer{
	Name:       "testfuncs",
	Doc:        "extract test functions",
	Run:        extractTestFuncs,
	ResultType: reflect.TypeOf(make(TestFuncList, 0)),
}
View Source
var (
	TestNameStyle = &analysis.Analyzer{
		Name: "testnamestyle",
		Doc:  "check test naming style",
		Run:  run,
		Requires: []*analysis.Analyzer{
			TestFuncs,
		},
	}
)

Functions

This section is empty.

Types

type TestFuncList

type TestFuncList []*ast.FuncDecl

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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