mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 00:05:01 +00:00
quote the HEAD
This commit is contained in:
parent
fb80377d18
commit
529079ec01
2 changed files with 9 additions and 7 deletions
|
@ -348,12 +348,14 @@ def find_original_update_blocks(content):
|
||||||
if current_filename:
|
if current_filename:
|
||||||
filename = current_filename
|
filename = current_filename
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Bad/missing filename. It should go right above {HEAD}")
|
raise ValueError(
|
||||||
|
f"Bad/missing filename. It should go right above the {HEAD}"
|
||||||
|
)
|
||||||
except IndexError:
|
except IndexError:
|
||||||
if current_filename:
|
if current_filename:
|
||||||
filename = current_filename
|
filename = current_filename
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Bad/missing filename. It should go right above {HEAD}")
|
raise ValueError(f"Bad/missing filename. It should go right above the {HEAD}")
|
||||||
|
|
||||||
current_filename = filename
|
current_filename = filename
|
||||||
|
|
||||||
|
|
|
@ -32,22 +32,22 @@ some/dir/example.py
|
||||||
>>>>>>> updated
|
>>>>>>> updated
|
||||||
{fence[1]}
|
{fence[1]}
|
||||||
|
|
||||||
A program will parse the edit blocks you generate and replace the HEAD lines with the `updated` lines.
|
A program will parse the edit blocks you generate and replace the `HEAD` lines with the `updated` lines.
|
||||||
So edit blocks must be precise and unambiguous!
|
So edit blocks must be precise and unambiguous!
|
||||||
|
|
||||||
Every *edit block* must be fenced with {fence[0]}...{fence[1]} with the correct code language.
|
Every *edit block* must be fenced with {fence[0]}...{fence[1]} with the correct code language.
|
||||||
Every *edit block* must start with the full path! *NEVER* propose edit blocks for *read-only* files.
|
Every *edit block* must start with the full path! *NEVER* propose edit blocks for *read-only* files.
|
||||||
|
|
||||||
The HEAD section must be an *exact set of sequential lines* from the file!
|
The `HEAD` section must be an *exact set of sequential lines* from the file!
|
||||||
NEVER SKIP LINES in the HEAD section!
|
NEVER SKIP LINES in the `HEAD` section!
|
||||||
NEVER ELIDE LINES AND REPLACE THEM WITH A COMMENT!
|
NEVER ELIDE LINES AND REPLACE THEM WITH A COMMENT!
|
||||||
NEVER OMIT ANY WHITESPACE in the HEAD section!
|
NEVER OMIT ANY WHITESPACE in the `HEAD` section!
|
||||||
|
|
||||||
Edits to different parts of a file each need their own *edit block*.
|
Edits to different parts of a file each need their own *edit block*.
|
||||||
|
|
||||||
If you want to put code in a new file, use an edit block with:
|
If you want to put code in a new file, use an edit block with:
|
||||||
- A new file path, including dir name if needed
|
- A new file path, including dir name if needed
|
||||||
- An empty HEAD section
|
- An empty `HEAD` section
|
||||||
- The new file's contents in the `updated` section
|
- The new file's contents in the `updated` section
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue