From 1814638c1af4cd81989b19f8af10b158dec52838 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 18 May 2023 17:32:33 -0700 Subject: [PATCH] aider: Fixed indentation error in `aider/io.py`. # Context: USER: I ran this command: pytest tests/test_commands.py Which produced this output: ============================= test session starts ============================== platform darwin -- Python 3.11.3, pytest-7.3.1, pluggy-1.0.0 rootdir: /Users/gauthier/Projects/aider collected 0 items / 1 error ==================================== ERRORS ==================================== ___________________ ERROR collecting tests/test_commands.py ____________________ .venv/lib/python3.11/site-packages/_pytest/python.py:617: in _importtestmodule mod = import_path(self.path, mode=importmode, root=self.config.rootpath) .venv/lib/python3.11/site-packages/_pytest/pathlib.py:564: in import_path importlib.import_module(module_name) /usr/local/Cellar/python@3.11/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) :1206: in _gcd_import ??? :1178: in _find_and_load ??? :1149: in _find_and_load_unlocked ??? :690: in _load_unlocked ??? .venv/lib/python3.11/site-packages/_pytest/assertion/rewrite.py:172: in exec_module exec(co, module.__dict__) tests/test_commands.py:6: in from aider.io import InputOutput as IO E File "/Users/gauthier/Projects/aider/aider/io.py", line 117 E line = session.prompt() E IndentationError: unexpected indent =========================== short test summary info ============================ ERROR tests/test_commands.py !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! =============================== 1 error in 0.32s =============================== ASSISTANT: It seems there is an indentation error in the `aider/io.py` file. Please provide the content of the `aider/io.py` file so I can identify the issue and suggest a fix. USER: Please note that I shared content of these additional files: aider/io.py ASSISTANT: Apologies for the oversight. I see the indentation error in the `aider/io.py` file. Here's the fix: ```python aider/io.py <<<<<<< ORIGINAL session_kwargs = { "message": show, "completer": completer_instance, "style": style, "reserve_space_for_menu": 4, "complete_style": CompleteStyle.MULTI_COLUMN, "input": self.input, "output": self.output, } if self.input_history_file is not None: session_kwargs["history"] = FileHistory(self.input_history_file) session = PromptSession(**session_kwargs) line = session.prompt() ======= session_kwargs = { "message": show, "completer": completer_instance, "style": style, "reserve_space_for_menu": 4, "complete_style": CompleteStyle.MULTI_COLUMN, "input": self.input, "output": self.output, } if self.input_history_file is not None: session_kwargs["history"] = FileHistory(self.input_history_file) session = PromptSession(**session_kwargs) line = session.prompt() >>>>>>> UPDATED ``` This should fix the indentation error. Please apply the change and run the tests again. --- aider/io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/io.py b/aider/io.py index 8dd0719c8..857764586 100644 --- a/aider/io.py +++ b/aider/io.py @@ -114,7 +114,7 @@ class InputOutput: if self.input_history_file is not None: session_kwargs["history"] = FileHistory(self.input_history_file) session = PromptSession(**session_kwargs) - line = session.prompt() + line = session.prompt() if line.strip() == "{" and not multiline_input: multiline_input = True continue