chore: run formatting on codebase to pass CI

This commit is contained in:
Ralph Khreish
2025-04-09 10:07:49 +02:00
parent 01a5be25a8
commit 5e01399dca

View File

@@ -2856,7 +2856,12 @@ async function expandAllTasks(
mcpLog
);
if (aiResponse && aiResponse.subtasks && Array.isArray(aiResponse.subtasks) && aiResponse.subtasks.length > 0) {
if (
aiResponse &&
aiResponse.subtasks &&
Array.isArray(aiResponse.subtasks) &&
aiResponse.subtasks.length > 0
) {
// Process and add the subtasks to the task
task.subtasks = aiResponse.subtasks.map((subtask, index) => ({
id: index + 1,
@@ -2881,7 +2886,10 @@ async function expandAllTasks(
expansionErrors++;
} else {
report(`Failed to generate subtasks for task ${task.id}`, 'error');
report(`Suggestion: Run 'task-master update-task --id=${task.id} --prompt="Generate subtasks for this task"' to manually create subtasks.`, 'info');
report(
`Suggestion: Run 'task-master update-task --id=${task.id} --prompt="Generate subtasks for this task"' to manually create subtasks.`,
'info'
);
expansionErrors++;
}
} catch (error) {
@@ -5677,8 +5685,14 @@ async function getSubtasksFromAI(
// Try to parse the subtasks
try {
const parsedSubtasks = parseSubtasksFromText(responseText);
if (!parsedSubtasks || !Array.isArray(parsedSubtasks) || parsedSubtasks.length === 0) {
throw new Error('Failed to parse valid subtasks array from AI response');
if (
!parsedSubtasks ||
!Array.isArray(parsedSubtasks) ||
parsedSubtasks.length === 0
) {
throw new Error(
'Failed to parse valid subtasks array from AI response'
);
}
return { subtasks: parsedSubtasks };
} catch (parseError) {
@@ -5692,7 +5706,8 @@ async function getSubtasksFromAI(
return {
error: parseError.message,
taskId: null, // This will be filled in by the calling function
suggestion: "Use 'task-master update-task --id=<id> --prompt=\"Generate subtasks for this task\"' to manually create subtasks."
suggestion:
'Use \'task-master update-task --id=<id> --prompt="Generate subtasks for this task"\' to manually create subtasks.'
};
}
} catch (error) {
@@ -5705,7 +5720,8 @@ async function getSubtasksFromAI(
return {
error: error.message,
taskId: null, // This will be filled in by the calling function
suggestion: "Use 'task-master update-task --id=<id> --prompt=\"Generate subtasks for this task\"' to manually create subtasks."
suggestion:
'Use \'task-master update-task --id=<id> --prompt="Generate subtasks for this task"\' to manually create subtasks.'
};
}
}