coderabbitai / ai-pr-reviewer

AI-based Pull Request Summarizer and Reviewer with Chat Capabilities.
https://coderabbit.ai
MIT License
1.42k stars 261 forks source link

single line comments #411

Closed harjotgill closed 11 months ago

harjotgill commented 11 months ago

Summary by CodeRabbit

Refactor:

🎉 Here's to the code that we refine,
With each little tweak, it shines more divine.
Single line comments, now easier to find,
Making our reviews more streamlined and kind. 🥳

github-actions[bot] commented 11 months ago

Image description CodeRabbit

Walkthrough: This update primarily focuses on refining the format of annotations in code hunks and handling single line comments more effectively. It introduces a new regular expression to match single line comments and updates guidelines for providing comments during code reviews.

Changes:

Files Summary
src/prompts.ts, src/review.ts The changes include an updated annotation format in code hunks, from <line_number>: to <line_number>:<whitespace>. A new section has been added for response instructions and the expected response format is clarified. In src/review.ts, a new regular expression (lineNumberSingleRegex) has been introduced to match single line comments. Single line comments are now handled separately, with their review stored and start and end lines set to be the same. In src/prompts.ts, lines have been modified to match the new format and guidelines for providing comments in the code review have been updated.

Notes ### Chat with Image description CodeRabbit Bot (`@coderabbitai`) - Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file. - Invite the bot into a review comment chain by tagging `@coderabbitai` in a reply. ### Code suggestions - The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned. - You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off. ### Ignoring further reviews - Type `@coderabbitai: ignore` anywhere in the PR description to ignore further reviews from the bot. ### Support us :) If you like this project, please support us by purchasing the [Pro version](https://coderabbit.ai)! The Pro version has advanced context and several proprietary improvements compared to the open source version.