Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReportViolations ¶
func ReportViolations(pass *analysis.Pass, violations []TestOnlyViolation)
ReportViolations reports testonly violations using the new pretty formatter NOTE: violations should already be filtered by @ignore directives in CheckTestOnly
Types ¶
type TestOnlyViolation ¶
type TestOnlyViolation struct {
Pos token.Pos
TestOnlyObj string // Name of the @testonly object being used
Kind annotations.TestOnlyKind
UsedInFile string // File where @testonly object is used
Reason string
Code string // Error code from codes package
}
TestOnlyViolation represents a violation of @testonly usage @immutable implements reporting.Violation
func CheckTestOnly ¶
func CheckTestOnly( cfg *config.Config, pass *analysis.Pass, packageAnnotations *annotations.PackageAnnotations, ignoreSet *util.IgnoreSet, ) []TestOnlyViolation
CheckTestOnly checks that @testonly annotated items are only used in test files
func (TestOnlyViolation) GetCode ¶
func (v TestOnlyViolation) GetCode() string
GetCode returns the error code for this violation
func (TestOnlyViolation) GetMessage ¶
func (v TestOnlyViolation) GetMessage() string
GetMessage returns the main error message without formatting
func (TestOnlyViolation) GetPos ¶
func (v TestOnlyViolation) GetPos() token.Pos
GetPos returns the position of the violation
Click to show internal directories.
Click to hide internal directories.