mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-06 22:00:40 +08:00
fix: exclude TODO prompt if require_todo_scan is false
This commit is contained in:
@ -72,10 +72,12 @@ class KeyIssuesComponentLink(BaseModel):
|
|||||||
start_line: int = Field(description="The start line that corresponds to this issue in the relevant file")
|
start_line: int = Field(description="The start line that corresponds to this issue in the relevant file")
|
||||||
end_line: int = Field(description="The end line that corresponds to this issue in the relevant file")
|
end_line: int = Field(description="The end line that corresponds to this issue in the relevant file")
|
||||||
|
|
||||||
|
{%- if require_todo_scan %}
|
||||||
class TodoSection(BaseModel):
|
class TodoSection(BaseModel):
|
||||||
relevant_file: str = Field(description="The file containing the TODO comment")
|
relevant_file: str = Field(description="The file containing the TODO comment")
|
||||||
line_range: Tuple[int, int] = Field(description="Start and end line numbers of the TODO comment (inclusive). Must be a tuple of two integers, e.g., (7, 7) for a single line or (7, 10) for a range. Do not use list format [7, 7].")
|
line_range: Tuple[int, int] = Field(description="Start and end line numbers of the TODO comment (inclusive). Must be a tuple of two integers, e.g., (7, 7) for a single line or (7, 10) for a range. Do not use list format [7, 7].")
|
||||||
content: str = Field(description="The content of the TODO comment. Only include actual TODO comments within code comments (e.g., lines starting with '#', '//', '/*', '<!--'). Remove leading 'TODO' prefixes. Include lines like '# TODO', even if empty after prefix removal. Exclude TODOs outside comments or without appropriate prefixes. Use | block style only when the line range covers multiple lines (e.g., (7, 10)).")
|
content: str = Field(description="The content of the TODO comment. Only include actual TODO comments within code comments (e.g., lines starting with '#', '//', '/*', '<!--'). Remove leading 'TODO' prefixes. Include lines like '# TODO', even if empty after prefix removal. Exclude TODOs outside comments or without appropriate prefixes. Use | block style only when the line range covers multiple lines (e.g., (7, 10)).")
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
{%- if related_tickets %}
|
{%- if related_tickets %}
|
||||||
|
|
||||||
@ -157,10 +159,12 @@ review:
|
|||||||
- ...
|
- ...
|
||||||
security_concerns: |
|
security_concerns: |
|
||||||
No
|
No
|
||||||
|
{%- if require_todo_scan %}
|
||||||
todo_sections: |
|
todo_sections: |
|
||||||
No
|
No
|
||||||
todo_summary: |
|
todo_summary: |
|
||||||
...
|
...
|
||||||
|
{%- endif %}
|
||||||
{%- if require_can_be_split_review %}
|
{%- if require_can_be_split_review %}
|
||||||
can_be_split:
|
can_be_split:
|
||||||
- relevant_files:
|
- relevant_files:
|
||||||
@ -279,10 +283,12 @@ review:
|
|||||||
- ...
|
- ...
|
||||||
security_concerns: |
|
security_concerns: |
|
||||||
No
|
No
|
||||||
|
{%- if require_todo_scan %}
|
||||||
todo_sections: |
|
todo_sections: |
|
||||||
No
|
No
|
||||||
todo_summary: |
|
todo_summary: |
|
||||||
...
|
...
|
||||||
|
{%- endif %}
|
||||||
{%- if require_can_be_split_review %}
|
{%- if require_can_be_split_review %}
|
||||||
can_be_split:
|
can_be_split:
|
||||||
- relevant_files:
|
- relevant_files:
|
||||||
|
Reference in New Issue
Block a user