Skip to content

Commit

Permalink
src/openaiExplainPatch.js: enforce folding format
Browse files Browse the repository at this point in the history
  • Loading branch information
thypon committed Dec 18, 2023
1 parent d518490 commit 610077d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/openaiExplainPatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,9 @@ Desired format:
### Description
<description_of_PR> // How does this PR change the codebase? What is the motivation for this change?
<details>
<summary><i>Changes</i></summary>
### Changes
<list_of_changes> // Describe the main changes in the PR, organizing them by filename
</details>
### Security Hotspots
<list_of_security_hotspots> // Describe locations for possible vulnerabilities in the change, order by risk
\n`,
Expand Down Expand Up @@ -156,5 +151,11 @@ Desired format:
console.log(aiResponse.choices[0].message);
}

return aiResponse.choices[0].message.content+`\n\n<!-- Generated by ${m} -->`;
var response = aiResponse.choices[0].message.content;

response = response.replaceAll("### Changes", "<details>\n<summary><i>Changes</i></summary>\n\n### Changes");
response = response.replaceAll("### Security Hotspots", "</details>\n\n### Security Hotspots");
response += `\n\n<!-- Generated by ${m} -->`;

return response;
}

0 comments on commit 610077d

Please sign in to comment.