testfile

package module
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2026 License: MIT Imports: 10 Imported by: 0

README

Documentation

Overview

Package testfile provides a go/analysis analyzer enforcing the gomatic Go testing standard that unit-test files are 1:1 with their source files: <name>_test.go tests <name>.go. A _test.go file without a matching source file is allowed only when it is not a unit test — it carries a build constraint (integration tests) or declares no Test functions (examples, benchmarks, fuzz targets).

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name: "testfile",
	Doc:  "reports _test.go unit-test files without a matching source file",
	Run:  run,
}

Analyzer reports unit-test files that are not 1:1 with a source file.

View Source
var Registration = goyze.Registration{
	Name:       "testfile",
	Categories: []goyze.Category{"testing"},
	URL:        "https://docs.gomatic.dev/yze/testfile",
	Analyzer:   Analyzer,
}

Registration declares this analyzer to the yze framework.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
cmd
yze-go-testfile command
Command yze-go-testfile runs the testfile analyzer as a standalone go/analysis checker (text and -json output, and as a `go vet -vettool`).
Command yze-go-testfile runs the testfile analyzer as a standalone go/analysis checker (text and -json output, and as a `go vet -vettool`).

Jump to

Keyboard shortcuts

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