mirror of
				https://github.com/freeedcom/ai-codereviewer.git
				synced 2025-10-31 14:10:54 +00:00 
			
		
		
		
	Added debugging information for comments that are excluded from PRs actual code
This commit is contained in:
		
					parent
					
						
							
								6791d85b9d
							
						
					
				
			
			
				commit
				
					
						8ded98d88f
					
				
			
		
					 3 changed files with 17 additions and 1 deletions
				
			
		
							
								
								
									
										8
									
								
								dist/index.js
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								dist/index.js
									
										
									
									
										vendored
									
									
								
							|  | @ -221,6 +221,14 @@ require("./sourcemap-register.js"); | ||||||
|                 const validAIResponses = aiResponse.filter((response) => |                 const validAIResponses = aiResponse.filter((response) => | ||||||
|                   validLineNumbers.has(Number(response.lineNumber)) |                   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( |                 const newComments = createComment( | ||||||
|                   file, |                   file, | ||||||
|                   chunk, |                   chunk, | ||||||
|  |  | ||||||
							
								
								
									
										2
									
								
								dist/index.js.map
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/index.js.map
									
										
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							|  | @ -128,6 +128,14 @@ async function analyzeCode( | ||||||
|         const validAIResponses = aiResponse.filter((response) => |         const validAIResponses = aiResponse.filter((response) => | ||||||
|           validLineNumbers.has(Number(response.lineNumber)) |           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); |         const newComments = createComment(file, chunk, validAIResponses); | ||||||
|         if (newComments) { |         if (newComments) { | ||||||
|           comments.push(...newComments); |           comments.push(...newComments); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue