task

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// IdentifierWriteTests holds the identifier for the "write test" task.
	IdentifierWriteTests = registerIdentifier("write-tests")
	// IdentifierWriteTestsSymflowerFix holds the identifier for the "write test" task with the "symflower fix" applied.
	IdentifierWriteTestsSymflowerFix = registerIdentifier("write-tests-symflower-fix")
	// IdentifierWriteTestsSymflowerTemplate holds the identifier for the "write test" task based on a Symflower template.
	IdentifierWriteTestsSymflowerTemplate = registerIdentifier("write-tests-symflower-template")
	// IdentifierWriteTestsSymflowerTemplateSymflowerFix holds the identifier for the "write test" task based on a Symflower template with the "symflower fix" applied.
	IdentifierWriteTestsSymflowerTemplateSymflowerFix = registerIdentifier("write-tests-symflower-template-symflower-fix")
	// IdentifierCodeRepair holds the identifier for the "code repair" task.
	IdentifierCodeRepair = registerIdentifier("code-repair")
	// IdentifierMigrate holds the identifier for the "migrate" task.
	IdentifierMigrate = registerIdentifier("migrate")
	// IdentifierMigrateSymflowerFix holds the identifier for the "migrate" task. with the "symflower fix" applied.
	IdentifierMigrateSymflowerFix = registerIdentifier("migrate-symflower-fix")
	// IdentifierTranspile holds the identifier for the "transpile" task.
	IdentifierTranspile = registerIdentifier("transpile")
	// IdentifierTranspileSymflowerFix holds the identifier for the "transpile" task with the "symflower fix" applied.
	IdentifierTranspileSymflowerFix = registerIdentifier("transpile-symflower-fix")
)
View Source
var (
	// AllIdentifiers holds all available task identifiers.
	AllIdentifiers []evaltask.Identifier
)

Functions

func ExecuteWithSymflowerFix

func ExecuteWithSymflowerFix(ctx evaltask.Context, logger *log.Logger, packagePath string) (testResult *language.TestResult, processingTime uint64, problems []error, err error)

ExecuteWithSymflowerFix runs the "symflower fix" command and calculates the new assessments.

func ForIdentifier added in v1.0.0

func ForIdentifier(taskIdentifier evaltask.Identifier) (task evaltask.Task, err error)

ForIdentifier returns a task based on the task identifier.

Types

type ArgumentsCodeRepair added in v1.0.0

type ArgumentsCodeRepair struct {
	// Mistakes holds the list of compilation errors for a package.
	Mistakes []string
}

ArgumentsCodeRepair holds extra arguments to be used in a query prompt.

type ArgumentsMigrate added in v1.0.0

type ArgumentsMigrate struct {
	// TestFramework holds the test framework to use.
	TestFramework string
}

ArgumentsMigrate holds extra arguments to be used in a query prompt.

type ArgumentsTranspile added in v1.0.0

type ArgumentsTranspile struct {
	// OriginLanguage holds the language we are transpiling from.
	OriginLanguage language.Language
	// OriginFilePath holds the path for the file containing the source code we want to transpile.
	OriginFilePath string
}

ArgumentsTranspile holds extra arguments to be used in a query prompt.

type ArgumentsWriteTest added in v1.0.0

type ArgumentsWriteTest struct {
	// Template holds the template data to base the tests onto.
	Template string
	// TestFramework holds the test framework to use.
	TestFramework string
}

ArgumentsWriteTest holds extra arguments to be used in a query prompt.

type CodeRepair added in v1.0.0

type CodeRepair struct {
}

CodeRepair holds the code repair task.

func (*CodeRepair) Identifier added in v1.0.0

func (t *CodeRepair) Identifier() evaltask.Identifier

Identifier returns the code repair task identifier.

func (*CodeRepair) Run added in v1.0.0

func (t *CodeRepair) Run(ctx evaltask.Context) (repositoryAssessment map[string]map[evaltask.Identifier]metrics.Assessments, problems []error, err error)

Run performs source code repairing in a repository with compilation errors. This task requires the repository to consist of multiple packages, with each containing one faulty implementation file and a corresponding test file.

type Migrate added in v1.0.0

type Migrate struct{}

Migrate holds the migration task.

func (*Migrate) Identifier added in v1.0.0

func (t *Migrate) Identifier() evaltask.Identifier

Identifier returns the migration task identifier.

func (*Migrate) Run added in v1.0.0

func (t *Migrate) Run(ctx evaltask.Context) (repositoryAssessment map[string]map[evaltask.Identifier]metrics.Assessments, problems []error, err error)

Run migrates code and runs the generated tests to check if the migration was successful.

type Repository

type Repository struct {
	task.RepositoryConfiguration
	// contains filtered or unexported fields
}

Repository holds data about a repository.

func TemporaryRepository

func TemporaryRepository(logger *log.Logger, testDataPath string, repositoryPathRelative string) (repository *Repository, cleanup func(), err error)

TemporaryRepository creates a temporary repository and initializes a git repo in it.

func (*Repository) Configuration added in v1.0.0

func (r *Repository) Configuration() *task.RepositoryConfiguration

Configuration returns the configuration of a repository.

func (*Repository) DataPath

func (r *Repository) DataPath() (dataPath string)

DataPath holds the absolute path to the repository.

func (*Repository) Name

func (r *Repository) Name() (name string)

Name holds the name of the repository.

func (*Repository) Reset

func (r *Repository) Reset(logger *log.Logger) (err error)

Reset resets a repository back to its "initial" commit.

func (*Repository) Validate

func (r *Repository) Validate(logger *log.Logger, language language.Language) (err error)

Validate checks it the repository is well-formed.

type Transpile added in v1.0.0

type Transpile struct{}

Transpile holds the transpilation task.

func (*Transpile) Identifier added in v1.0.0

func (t *Transpile) Identifier() evaltask.Identifier

Identifier returns the transpilation task identifier.

func (*Transpile) Run added in v1.0.0

func (t *Transpile) Run(ctx evaltask.Context) (repositoryAssessment map[string]map[evaltask.Identifier]metrics.Assessments, problems []error, err error)

Run transpiles code between languages and runs predefined tests to check if the transpilation was successful.

type WriteTests added in v1.0.0

type WriteTests struct {
}

WriteTests holds the write test task.

func (*WriteTests) Identifier added in v1.0.0

func (t *WriteTests) Identifier() evaltask.Identifier

Identifier returns the write test task identifier.

func (*WriteTests) Run added in v1.0.0

func (t *WriteTests) Run(ctx evaltask.Context) (repositoryAssessment map[string]map[evaltask.Identifier]metrics.Assessments, problems []error, err error)

Run generates test files for the given implementation file in a repository.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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