mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 18:54:59 +00:00
style: Apply linter to editblock_coder.py
This commit is contained in:
parent
f28504a2eb
commit
c6ce871700
1 changed files with 8 additions and 4 deletions
|
@ -413,12 +413,12 @@ def strip_filename(filename, fence):
|
||||||
|
|
||||||
start_fence = fence[0]
|
start_fence = fence[0]
|
||||||
if filename.startswith(start_fence):
|
if filename.startswith(start_fence):
|
||||||
candidate = filename[len(start_fence):]
|
candidate = filename[len(start_fence) :]
|
||||||
if candidate and "." in candidate:
|
if candidate and "." in candidate:
|
||||||
return candidate
|
return candidate
|
||||||
|
|
||||||
if filename.startswith(triple_backticks):
|
if filename.startswith(triple_backticks):
|
||||||
filename = filename[len(triple_backticks):]
|
filename = filename[len(triple_backticks) :]
|
||||||
|
|
||||||
filename = filename.rstrip(":")
|
filename = filename.rstrip(":")
|
||||||
filename = filename.lstrip("#")
|
filename = filename.lstrip("#")
|
||||||
|
@ -461,8 +461,12 @@ def find_original_update_blocks(content, fence=DEFAULT_FENCE, valid_fnames=None)
|
||||||
]
|
]
|
||||||
|
|
||||||
# Check if the next line or the one after that is an editblock
|
# Check if the next line or the one after that is an editblock
|
||||||
next_is_editblock = (i + 1 < len(lines) and head_pattern.match(lines[i + 1].strip())
|
next_is_editblock = (
|
||||||
or i + 2 < len(lines) and head_pattern.match(lines[i + 2].strip()))
|
i + 1 < len(lines)
|
||||||
|
and head_pattern.match(lines[i + 1].strip())
|
||||||
|
or i + 2 < len(lines)
|
||||||
|
and head_pattern.match(lines[i + 2].strip())
|
||||||
|
)
|
||||||
|
|
||||||
if any(line.strip().startswith(start) for start in shell_starts) and not next_is_editblock:
|
if any(line.strip().startswith(start) for start in shell_starts) and not next_is_editblock:
|
||||||
shell_content = []
|
shell_content = []
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue