Added debugging information for comments that are excluded from PRs actual code

This commit is contained in:
Jimmy Royer 2024-09-17 14:55:59 -04:00
parent 6791d85b9d
commit 8ded98d88f
3 changed files with 17 additions and 1 deletions

View file

@ -128,6 +128,14 @@ async function analyzeCode(
const validAIResponses = aiResponse.filter((response) =>
validLineNumbers.has(Number(response.lineNumber))
);
// Leave a log for each invalid line numbers for further debugging.
aiResponse.forEach((response) => {
if (!validLineNumbers.has(Number(response.lineNumber))) {
console.log(
`Invalid line number: ${response.lineNumber} in file: ${file.to}\nComment: ${response.reviewComment}`
);
}
});
const newComments = createComment(file, chunk, validAIResponses);
if (newComments) {
comments.push(...newComments);