mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 09:44:59 +00:00
style: Apply linter to patch_flex_coder.py
This commit is contained in:
parent
152b8912ae
commit
134a2d60fe
1 changed files with 28 additions and 20 deletions
|
@ -304,7 +304,10 @@ class PatchFlexCoder(Coder): # Rename class
|
||||||
self.io.tool_warning(f"Delete File target '{path}' not found in chat context.")
|
self.io.tool_warning(f"Delete File target '{path}' not found in chat context.")
|
||||||
|
|
||||||
parsed_edits.append(
|
parsed_edits.append(
|
||||||
(path, ParsedEdit(path=path, type=ActionType.DELETE, patch_line_num=line_num)) # Wrap in tuple
|
(
|
||||||
|
path,
|
||||||
|
ParsedEdit(path=path, type=ActionType.DELETE, patch_line_num=line_num),
|
||||||
|
) # Wrap in tuple
|
||||||
)
|
)
|
||||||
current_file_path = None # Reset current file context
|
current_file_path = None # Reset current file context
|
||||||
current_move_path = None
|
current_move_path = None
|
||||||
|
@ -375,7 +378,8 @@ class PatchFlexCoder(Coder): # Rename class
|
||||||
replace_text += "\n"
|
replace_text += "\n"
|
||||||
|
|
||||||
parsed_edits.append(
|
parsed_edits.append(
|
||||||
(current_file_path, # Add path to tuple
|
(
|
||||||
|
current_file_path, # Add path to tuple
|
||||||
ParsedEdit(
|
ParsedEdit(
|
||||||
path=current_file_path,
|
path=current_file_path,
|
||||||
type=ActionType.UPDATE,
|
type=ActionType.UPDATE,
|
||||||
|
@ -383,7 +387,8 @@ class PatchFlexCoder(Coder): # Rename class
|
||||||
replace_text=replace_text,
|
replace_text=replace_text,
|
||||||
move_path=current_move_path, # Carry over move path for this hunk
|
move_path=current_move_path, # Carry over move path for this hunk
|
||||||
patch_line_num=hunk_start_index + 1,
|
patch_line_num=hunk_start_index + 1,
|
||||||
))
|
),
|
||||||
|
)
|
||||||
)
|
)
|
||||||
index = next_index
|
index = next_index
|
||||||
continue
|
continue
|
||||||
|
@ -457,7 +462,10 @@ class PatchFlexCoder(Coder): # Rename class
|
||||||
final_move_path = None # Track the last move destination for this file
|
final_move_path = None # Track the last move destination for this file
|
||||||
|
|
||||||
# Check for simple ADD/DELETE first (should ideally be only one per file)
|
# Check for simple ADD/DELETE first (should ideally be only one per file)
|
||||||
if len(path_edits) == 1 and path_edits[0][1].type in [ActionType.ADD, ActionType.DELETE]:
|
if len(path_edits) == 1 and path_edits[0][1].type in [
|
||||||
|
ActionType.ADD,
|
||||||
|
ActionType.DELETE,
|
||||||
|
]:
|
||||||
_path, edit = path_edits[0] # Unpack tuple
|
_path, edit = path_edits[0] # Unpack tuple
|
||||||
try:
|
try:
|
||||||
if edit.type == ActionType.ADD:
|
if edit.type == ActionType.ADD:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue