-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TODO Apply "symflower fix" to a "write-test" result of a model when i…
…t errors, so model responses can possibly be fixed Part of #213
- Loading branch information
1 parent
fcf95c4
commit a3ab62b
Showing
6 changed files
with
200 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package task | ||
|
||
import ( | ||
"context" | ||
"time" | ||
|
||
pkgerrors "github.com/pkg/errors" | ||
"github.com/symflower/eval-dev-quality/evaluate/metrics" | ||
"github.com/symflower/eval-dev-quality/language" | ||
"github.com/symflower/eval-dev-quality/log" | ||
"github.com/symflower/eval-dev-quality/tools" | ||
"github.com/symflower/eval-dev-quality/util" | ||
) | ||
|
||
// symflowerFix runs the "symflower fix" command and returns its execution time in milliseconds. | ||
func symflowerFix(logger *log.Logger, modelAssessment metrics.Assessments, repositoryPath string, language language.Language) (duration uint64, err error) { | ||
start := time.Now() | ||
_, err = util.CommandWithResult(context.Background(), logger, &util.Command{ | ||
Command: []string{ | ||
tools.SymflowerPath, "fix", | ||
"--language", language.ID(), | ||
"--workspace", repositoryPath, | ||
}, | ||
|
||
Directory: repositoryPath, | ||
}) | ||
if err != nil { | ||
return 0, pkgerrors.WithStack(err) | ||
} | ||
|
||
return uint64(time.Since(start).Milliseconds()), nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters