CodeBench: korvaa go.mod aina golden versiolla — pienet mallit tuottavat vääriä moduulipolkuja
This commit is contained in:
@@ -411,12 +411,11 @@ async function runPipeline(model, scenario, round = 1) {
|
|||||||
const missing = LCONF.required.filter(f => !files[f]);
|
const missing = LCONF.required.filter(f => !files[f]);
|
||||||
if (missing.length > 0) { result.error = `Puuttuvat: ${missing.join(', ')}`; return result; }
|
if (missing.length > 0) { result.error = `Puuttuvat: ${missing.join(', ')}`; return result; }
|
||||||
|
|
||||||
// Go: korjaa go.mod jos malli tuottaa viallisen (puuttuvat versiot)
|
// Go: korvaa go.mod aina golden examplen versiolla (pienet mallit eivät tuota luotettavaa go.modia)
|
||||||
if (LANG === 'go' && files['go.mod'] && !/v\d+\.\d+/.test(files['go.mod'])) {
|
if (LANG === 'go' && files['go.mod']) {
|
||||||
const goldenMod = readFileSync(join(GOLDEN_DIR, 'todo-go', 'go.mod'), 'utf-8');
|
const goldenMod = readFileSync(join(GOLDEN_DIR, 'todo-go', 'go.mod'), 'utf-8');
|
||||||
const modName = files['go.mod'].match(/^module\s+(\S+)/m)?.[1] || 'generated-api';
|
const modName = files['go.mod'].match(/^module\s+(\S+)/m)?.[1] || 'generated-api';
|
||||||
files['go.mod'] = goldenMod.replace(/^module\s+\S+/m, `module ${modName}`);
|
files['go.mod'] = goldenMod.replace(/^module\s+\S+/m, `module ${modName}`);
|
||||||
console.log(` [3/5] ⚠ go.mod korjattu (puuttuvat versiot)`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4. Validointi + korjaussilmukka
|
// 4. Validointi + korjaussilmukka
|
||||||
|
|||||||
Reference in New Issue
Block a user