Skip to content

Improve code analysis instructions for handling partial code blocks i…#1663

Merged
mrT23 merged 2 commits intomainfrom
tr/prompts_and_logic
Mar 31, 2025
Merged

Improve code analysis instructions for handling partial code blocks i…#1663
mrT23 merged 2 commits intomainfrom
tr/prompts_and_logic

Conversation

@mrT23
Copy link
Copy Markdown
Contributor

@mrT23 mrT23 commented Mar 30, 2025

User description

…n PR reviews


PR Type

Documentation, Enhancement


Description

  • Improved instructions for handling partial code blocks in PR reviews.

  • Clarified guidelines for quoting variables and file paths.

  • Updated field descriptions for better clarity and precision.

  • Enhanced prompts to acknowledge visible scope boundaries in code.


Changes walkthrough 📝

Relevant files
Documentation
pr_code_suggestions_prompts_not_decoupled.toml
Clarified scope handling and field descriptions                   

pr_agent/settings/code_suggestions/pr_code_suggestions_prompts_not_decoupled.toml

  • Added clarification on handling code ending at scope boundaries.
  • Refined description for existing_code field to focus on modified
    spans.
  • +2/-1     
    pr_reviewer_prompts.toml
    Enhanced review instructions and field descriptions           

    pr_agent/settings/pr_reviewer_prompts.toml

  • Added guidance on handling code ending at scope boundaries.
  • Improved instructions for quoting variables and file paths.
  • Refined description for issue_content field to avoid line references.
  • +3/-2     

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • @qodo-free-for-open-source-projects
    Copy link
    Copy Markdown
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ No major issues detected

    @mrT23 mrT23 requested a review from ofir-frd March 31, 2025 05:39
    @Ant0n-hhh

    This comment was marked as abuse.

    21 similar comments
    @Ant0n-hhh

    This comment was marked as abuse.

    @Ant0n-hhh

    This comment was marked as abuse.

    @Ant0n-hhh

    This comment was marked as abuse.

    @Ant0n-hhh

    This comment was marked as abuse.

    @Ant0n-hhh

    This comment was marked as abuse.

    @Ant0n-hhh

    This comment was marked as abuse.

    @Ant0n-hhh

    This comment was marked as abuse.

    @Ant0n-hhh

    This comment was marked as abuse.

    @Ant0n-hhh

    This comment was marked as abuse.

    @Ant0n-hhh

    This comment was marked as abuse.

    @Ant0n-hhh

    This comment was marked as abuse.

    @Ant0n-hhh

    This comment was marked as abuse.

    @Ant0n-hhh

    This comment was marked as abuse.

    @Ant0n-hhh

    This comment was marked as abuse.

    @Ant0n-hhh

    This comment was marked as abuse.

    @Ant0n-hhh

    This comment was marked as abuse.

    @Ant0n-hhh

    This comment was marked as abuse.

    @Ant0n-hhh

    This comment was marked as abuse.

    @Ant0n-hhh

    This comment was marked as abuse.

    @Ant0n-hhh

    This comment was marked as abuse.

    @Ant0n-hhh

    This comment was marked as abuse.

    @mrT23
    Copy link
    Copy Markdown
    Contributor Author

    mrT23 commented Mar 31, 2025

    @Ant0n-hhh
    remove all comments immediately or you will be blocked.
    Dont spam, especially not live PRs

    @Ant0n-hhh

    This comment was marked as abuse.

    @Ant0n-hhh

    This comment was marked as abuse.

    3 similar comments
    @Ant0n-hhh

    This comment was marked as abuse.

    @Ant0n-hhh

    This comment was marked as abuse.

    @Ant0n-hhh

    This comment was marked as abuse.

    @mrT23 mrT23 merged commit ed00ef6 into main Mar 31, 2025
    2 checks passed
    @mrT23 mrT23 deleted the tr/prompts_and_logic branch March 31, 2025 10:56
    @mrT23
    Copy link
    Copy Markdown
    Contributor Author

    mrT23 commented Apr 1, 2025

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Impact
    General
    Clarify 'existing_code' field description

    Consider clarifying that the 'existing_code' should include the problematic code
    that needs improvement, not just the code that will be directly modified.

    pr_agent/settings/code_suggestions/pr_code_suggestions_prompts_not_decoupled.toml [80]

    -existing_code: str = Field(description="A short code snippet from the final state of the PR diff that the suggestion will address. Select only the span of code that will be modified - without surrounding unchanged code. Preserve all indentation, newlines, and original formatting. Use ellipsis (...) for brevity if needed.")
    +existing_code: str = Field(description="A short code snippet from the final state of the PR diff that the suggestion will address. Include the problematic code that needs improvement, not just the code that will be directly modified. Preserve all indentation, newlines, and original formatting. Use ellipsis (...) for brevity if needed.")
    Suggestion importance[1-10]: 7

    __

    Why: The suggestion improves clarity by specifying that the 'existing_code' should include problematic code needing improvement, not just code to be modified. This enhances understanding and usage of the field.

    Medium
    Enhance issue_content field description

    Consider adding a note to encourage providing specific details or examples in the
    issue_content, while maintaining brevity.

    pr_agent/settings/pr_reviewer_prompts.toml [71]

    -issue_content: str = Field(description="A short and concise summary of what should be further inspected and validated during the PR review process for this issue. Do not mention line numbers in this field.")
    +issue_content: str = Field(description="A short and concise summary of what should be further inspected and validated during the PR review process for this issue. Provide specific details or examples where possible, but do not mention line numbers in this field.")
    Suggestion importance[1-10]: 6

    __

    Why: The suggestion adds value by encouraging the inclusion of specific details or examples in the issue_content, which can lead to more informative and actionable summaries.

    Low

    @mrT23
    Copy link
    Copy Markdown
    Contributor Author

    mrT23 commented Apr 8, 2025

    PR Code Suggestions ✨

    Latest suggestions up to 20cb139

    CategorySuggestion                                                                                                                                    Impact
    General
    Enhance grammatical clarity

    Rephrase the segment for clarity and grammatical consistency; for example, replace
    "or questioning code elements" with "or question the existence of code elements".

    pr_agent/settings/pr_reviewer_prompts.toml [47]

    -- Note that you only see changed code segments (diff hunks in a PR), not the entire codebase. Avoid suggestions that might duplicate existing functionality or questioning code elements (like variables declarations or import statements) that may be defined elsewhere in the codebase.
    +- Note that you only see changed code segments (diff hunks in a PR), not the entire codebase. Avoid suggestions that might duplicate existing functionality or question the existence of code elements (like variable declarations or import statements) that may be defined elsewhere in the codebase.
    Suggestion importance[1-10]: 5

    __

    Why: The suggestion offers a minor grammatical rewording that improves clarity without altering code functionality, yielding a modest overall impact.

    Low

    Previous suggestions

    Suggestions
    CategorySuggestion                                                                                                                                    Impact
    General
    Clarify 'existing_code' field description

    Consider clarifying that the 'existing_code' should include the problematic code
    that needs improvement, not just the code that will be directly modified.

    pr_agent/settings/code_suggestions/pr_code_suggestions_prompts_not_decoupled.toml [80]

    -existing_code: str = Field(description="A short code snippet from the final state of the PR diff that the suggestion will address. Select only the span of code that will be modified - without surrounding unchanged code. Preserve all indentation, newlines, and original formatting. Use ellipsis (...) for brevity if needed.")
    +existing_code: str = Field(description="A short code snippet from the final state of the PR diff that the suggestion will address. Include the problematic code that needs improvement, not just the code that will be directly modified. Preserve all indentation, newlines, and original formatting. Use ellipsis (...) for brevity if needed.")
    Suggestion importance[1-10]: 7

    __

    Why: The suggestion improves clarity by specifying that the 'existing_code' should include problematic code needing improvement, not just code to be modified. This enhances understanding and usage of the field.

    Medium
    Enhance issue_content field description

    Consider adding a note to encourage providing specific details or examples in the
    issue_content, while maintaining brevity.

    pr_agent/settings/pr_reviewer_prompts.toml [71]

    -issue_content: str = Field(description="A short and concise summary of what should be further inspected and validated during the PR review process for this issue. Do not mention line numbers in this field.")
    +issue_content: str = Field(description="A short and concise summary of what should be further inspected and validated during the PR review process for this issue. Provide specific details or examples where possible, but do not mention line numbers in this field.")
    Suggestion importance[1-10]: 6

    __

    Why: The suggestion adds value by encouraging the inclusion of specific details or examples in the issue_content, which can lead to more informative and actionable summaries.

    Low

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    3 participants