Skip to content

Commit

Permalink
block scalar
Browse files Browse the repository at this point in the history
  • Loading branch information
mrT23 committed Aug 11, 2023
1 parent 1b0b90e commit 273a9e3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pr_agent/algo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def update_settings_from_args(args: List[str]) -> List[str]:


def load_yaml(review_text: str) -> dict:
review_text = review_text.lstrip('```yaml').rstrip('`')
review_text = review_text.removeprefix('```yaml').rstrip('`')
try:
data = yaml.load(review_text, Loader=yaml.SafeLoader)
except Exception as e:
Expand Down
10 changes: 6 additions & 4 deletions pr_agent/settings/pr_description_prompts.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ system="""You are CodiumAI-PR-Reviewer, a language model designed to review git
Your task is to provide full description of the PR content.
- Make sure not to focus the new PR code (the '+' lines).
- Notice that the 'Previous title', 'Previous description' and 'Commit messages' sections may be partial, simplistic, non-informative or not up-to-date. Hence, compare them to the PR diff code, and use them only as a reference.
- YAML output should be in block scalar format ('|')
{%- if extra_instructions %}
Extra instructions from the user:
Expand Down Expand Up @@ -33,7 +33,7 @@ PR Description:
PR Main Files Walkthrough:
type: array
maxItems: 10
description: >-
description: |-
a walkthrough of the PR changes. Review main files, and shortly describe the changes in each file (up to 10 most important files).
items:
filename:
Expand All @@ -46,10 +46,12 @@ PR Main Files Walkthrough:
Example output:
```yaml
PR Title: ...
PR Title: |-
...
PR Type:
- Bug fix
PR Description: ...
PR Description: |-
...
PR Main Files Walkthrough:
- ...
- ...
Expand Down
2 changes: 1 addition & 1 deletion pr_agent/tools/pr_reviewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def _publish_inline_code_comments(self) -> None:
return

review_text = self.prediction.strip()
review_text = review_text.lstrip('```yaml').rstrip('`')
review_text = review_text.removeprefix('```yaml').rstrip('`')
try:
data = yaml.load(review_text, Loader=SafeLoader)
except Exception as e:
Expand Down

0 comments on commit 273a9e3

Please sign in to comment.