From 454a2ebdcf78d1e2c1c93758499e123a6ac26fcf Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 20 Sep 2024 13:44:07 -0700 Subject: [PATCH] style: format code using linter --- aider/coders/editblock_coder.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/aider/coders/editblock_coder.py b/aider/coders/editblock_coder.py index a8762846b..118759e9c 100644 --- a/aider/coders/editblock_coder.py +++ b/aider/coders/editblock_coder.py @@ -454,9 +454,7 @@ def find_original_update_blocks(content, fence=DEFAULT_FENCE, valid_fnames=None) if i + 1 < len(lines) and divider_pattern.match(lines[i + 1].strip()): filename = find_filename(lines[max(0, i - 3) : i], fence, None) else: - filename = find_filename( - lines[max(0, i - 3) : i], fence, valid_fnames - ) + filename = find_filename(lines[max(0, i - 3) : i], fence, valid_fnames) if not filename: if current_filename: @@ -477,11 +475,17 @@ def find_original_update_blocks(content, fence=DEFAULT_FENCE, valid_fnames=None) updated_text = [] i += 1 - while i < len(lines) and not (updated_pattern.match(lines[i].strip()) or divider_pattern.match(lines[i].strip())): + while i < len(lines) and not ( + updated_pattern.match(lines[i].strip()) + or divider_pattern.match(lines[i].strip()) + ): updated_text.append(lines[i]) i += 1 - if i >= len(lines) or not (updated_pattern.match(lines[i].strip()) or divider_pattern.match(lines[i].strip())): + if i >= len(lines) or not ( + updated_pattern.match(lines[i].strip()) + or divider_pattern.match(lines[i].strip()) + ): raise ValueError(f"Expected `{UPDATED_ERR}` or `{DIVIDER_ERR}`") yield filename, "".join(original_text), "".join(updated_text)