-
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.
Apply "symflower fix" to a "write-test" result of a model when it err…
…ors, so model responses can possibly be fixed Closes of #213
- Loading branch information
1 parent
fcf95c4
commit 3df1a0d
Showing
11 changed files
with
564 additions
and
127 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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 | ||
} |
Oops, something went wrong.