mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-03 04:10:49 +08:00
fix: avoid incorrect ToDo header
This commit is contained in:
@ -154,7 +154,7 @@ def convert_to_markdown_v2(output_data: dict,
|
||||
|
||||
for key, value in output_data['review'].items():
|
||||
if value is None or value == '' or value == {} or value == []:
|
||||
if key.lower() not in ['can_be_split', 'key_issues_to_review', 'todo_sections']:
|
||||
if key.lower() not in ['can_be_split', 'key_issues_to_review']:
|
||||
continue
|
||||
key_nice = key.replace('_', ' ').capitalize()
|
||||
emoji = emojis.get(key_nice, "")
|
||||
|
@ -108,7 +108,7 @@ class Review(BaseModel):
|
||||
security_concerns: str = Field(description="Does this PR code introduce possible vulnerabilities such as exposure of sensitive information (e.g., API keys, secrets, passwords), or security concerns like SQL injection, XSS, CSRF, and others ? Answer 'No' (without explaining why) if there are no possible issues. If there are security concerns or issues, start your answer with a short header, such as: 'Sensitive information exposure: ...', 'SQL injection: ...' etc. Explain your answer. Be specific and give examples if possible")
|
||||
{%- endif %}
|
||||
{%- if require_todo_scan %}
|
||||
todo_sections: List[TodoSection] = Field(description="A list of TODO comments found in the code. Return an empty list if there are no TODO comments.")
|
||||
todo_sections: Union[List[TodoSection], str] = Field(description="A list of TODO comments found in the code. Return 'No' (as a string) if there are no TODO comments.")
|
||||
{%- endif %}
|
||||
{%- if require_can_be_split_review %}
|
||||
can_be_split: List[SubPR] = Field(min_items=0, max_items=3, description="Can this PR, which contains {{ num_pr_files }} changed files in total, be divided into smaller sub-PRs with distinct tasks that can be reviewed and merged independently, regardless of the order ? Make sure that the sub-PRs are indeed independent, with no code dependencies between them, and that each sub-PR represent a meaningful independent task. Output an empty list if the PR code does not need to be split.")
|
||||
@ -157,11 +157,7 @@ review:
|
||||
security_concerns: |
|
||||
No
|
||||
todo_sections:
|
||||
- relevant_file: |
|
||||
src/file1.py
|
||||
line_number: 13
|
||||
content: |
|
||||
...
|
||||
No
|
||||
{%- if require_can_be_split_review %}
|
||||
can_be_split:
|
||||
- relevant_files:
|
||||
@ -281,11 +277,7 @@ review:
|
||||
security_concerns: |
|
||||
No
|
||||
todo_sections:
|
||||
- relevant_file: |
|
||||
...
|
||||
line_number: ...
|
||||
content: |
|
||||
...
|
||||
No
|
||||
{%- if require_can_be_split_review %}
|
||||
can_be_split:
|
||||
- relevant_files:
|
||||
|
Reference in New Issue
Block a user