Skip to content

Commit 571c5d2

Browse files
committed
Refactor edit format instruction strings to use template literals for improved readability and consistency
1 parent f6826e9 commit 571c5d2

1 file changed

Lines changed: 24 additions & 6 deletions

File tree

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
1-
export const EDIT_FORMAT_INSTRUCTIONS_WHOLE =
2-
"Whenever showing a new or updated file, provide brief explanation, then print path in a markdown heading (e.g. ### New file `src/counter.py`, ### Updated file: `src/counter.py`), followed by a markdown code block with full contents—as I have a disability which means I can't type and need to be able to just copy and paste. Example:\nThe count variable has been incremented.\n### Updated file: `src/counter.py`\n```python\ncount = 20\n```"
1+
export const EDIT_FORMAT_INSTRUCTIONS_WHOLE = `Whenever showing a new or updated file, provide brief explanation, then print path in a markdown heading (e.g. ### New file: \`src/counter.py\`, ### Updated file: \`src/counter.py\`), followed by a markdown code block with full contents—as I have a disability which means I can't type and need to be able to just copy and paste. Example:
2+
The count variable has been incremented.
3+
### Updated file: \`src/counter.py\`
4+
\`\`\`python
5+
count = 20
6+
\`\`\``
37

4-
export const EDIT_FORMAT_INSTRUCTIONS_TRUNCATED =
5-
'Whenever showing a new or updated file, provide brief explanation, then print path in a markdown heading (e.g. ### New file: `src/counter.py`, ### Updated file: `src/counter.py`), followed by a markdown code block with truncated contents—as a space saving measure unchanged parts should be hidden behind ellipsis comments, e.g. "// ...". Example:\nThe count variable has been incremented.\n### Updated file: `src/counter.py`\n```python\n// ...\ncount = 20\n// ...\n```'
8+
export const EDIT_FORMAT_INSTRUCTIONS_TRUNCATED = `Whenever showing a new or updated file, provide brief explanation, then print path in a markdown heading (e.g. ### New file: \`src/counter.py\`, ### Updated file: \`src/counter.py\`), followed by a markdown code block with truncated contents—as a space saving measure unchanged parts should be hidden behind ellipsis comments, e.g. "// ...". Example:
9+
The count variable has been incremented.
10+
### Updated file: \`src/counter.py\`
11+
\`\`\`python
12+
// ...
13+
count = 20
14+
// ...
15+
\`\`\``
616

7-
export const EDIT_FORMAT_INSTRUCTIONS_DIFF =
8-
'Whenever showing a new, updated, renamed or deleted file, provide brief explanation, then print path in a markdown heading (e.g. ### New file: `src/counter.py`, ### Updated file: `src/counter.py`), followed by a unified diff within a markdown code block. Example:\nThe count variable has been incremented.\n### Updated file: `src/counter.py`\n```diff\n--- a/src/counter.py\n+++ b/src/counter.py\n@@ -2,1 +2,1 @@\n-count = 10\n+count = 20\n```'
17+
export const EDIT_FORMAT_INSTRUCTIONS_DIFF = `Whenever showing a new, updated, renamed or deleted file, provide brief explanation, then print path in a markdown heading (e.g. ### New file: \`src/counter.py\`, ### Updated file: \`src/counter.py\`), followed by a unified diff within a markdown code block. Example:
18+
The count variable has been incremented.
19+
### Updated file: \`src/counter.py\`
20+
\`\`\`diff
21+
--- a/src/counter.py
22+
+++ b/src/counter.py
23+
@@ -2,1 +2,1 @@
24+
-count = 10
25+
+count = 20
26+
\`\`\``

0 commit comments

Comments
 (0)