language

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoTestFound indicates that no tests could be found.
	ErrNoTestFound = errors.New("no tests could be found")
)

Common errors over all languages.

View Source
var Languages = map[string]Language{}

Languages holds a register of all languages.

Functions

func Register

func Register(language Language)

Register adds a language to the common language list.

Types

type Language

type Language interface {
	// ID returns the unique ID of this language.
	ID() (id string)
	// Name is the prose name of this language.
	Name() (id string)

	// Files returns a list of relative file paths of the repository that should be evaluated.
	Files(repositoryPath string) (filePaths []string, err error)

	// Execute invokes the language specific testing on the given repository.
	Execute(repositoryPath string) (coverage float64, err error)
}

Language defines a language to evaluate a repository.

type LanguageGolang

type LanguageGolang struct{}

LanguageGolang holds a Go language to evaluate a repository.

func (*LanguageGolang) Execute

func (language *LanguageGolang) Execute(repositoryPath string) (coverage float64, err error)

Execute invokes the language specific testing on the given repository.

func (*LanguageGolang) Files

func (language *LanguageGolang) Files(repositoryPath string) (filePaths []string, err error)

Files returns a list of relative file paths of the repository that should be evaluated.

func (*LanguageGolang) ID

func (language *LanguageGolang) ID() (id string)

ID returns the unique ID of this language.

func (*LanguageGolang) Name

func (language *LanguageGolang) Name() (id string)

Name is the prose name of this language.

Jump to

Keyboard shortcuts

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