Skip to content

Commit 0bcafa6

Browse files
authored
fix(#90): ensure three backticks in comments do not break markdown snippets (#91)
1 parent 62976ef commit 0bcafa6

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/lgtm_ai/ai/prompts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def _get_full_category_explanation() -> str:
101101
- Evaluate whether some comments are more likely to simply be incorrect. If they are likely to be incorrect, remove them.
102102
- Merge duplicate comments. If there are two comments that refer to the same issue, merge them into one.
103103
- Comments have a code snippet that they refer to. Consider whether the snippet needs a bit more code context, and if so, expand the snippet. Otherwise don't touch them.
104-
- If you can add a suggestion code snippet to the comment text, do it. Use markdown code blocks. Do it only when you are very sure about the suggestion with the context you have.
104+
- If you can add a suggestion code snippet to the comment text, do it. Use markdown code blocks with 5 backticks. Do it only when you are very sure about the suggestion with the context you have.
105105
- Check that categories of each comment are correct. Re-categorize them if needed.
106106
- Check the summary. Feel free to rephrase it, add more information, or generally improve it. The summary comment must be a general comment informing the PR author about the overall quality of the PR, the weakpoints it has, and which general issues need to be addressed.
107107
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
```{{ language }}
1+
`````{{ language }}
22
{{ snippet | safe }}
3-
```
3+
`````

tests/formatters/test_markdown.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,9 @@ def test_format_comment_with_snippet(self) -> None:
214214
"> **Severity:** LOW 🔵",
215215
"",
216216
"",
217-
"```python",
217+
"`````python",
218218
"print('Hello World')",
219-
"```",
219+
"`````",
220220
"",
221221
"",
222222
"comment",

0 commit comments

Comments
 (0)