Commit graph

1287 commits

Author SHA1 Message Date
Paul Gauthier
03f300ec75 aider: Updated test_repomap.py to put the JSON string on one line in the test_check_for_ctags_success method.
# Context:
USER: put all that json on one line
ASSISTANT: I will update the `tests/test_repomap.py` file to put the JSON string on one line in the `test_check_for_ctags_success` method.

```python
tests/test_repomap.py
<<<<<<< ORIGINAL
            mock_run.return_value = CompletedProcess(args=["ctags", "--version"], returncode=0, stdout=b'''{
  "_type": "tag",
  "name": "status",
  "path": "aider/main.py",
  "pattern": "/^    status = main()$/",
  "kind": "variable"
}''')
=======
            mock_run.return_value = CompletedProcess(args=["ctags", "--version"], returncode=0, stdout=b'{"_type": "tag", "name": "status", "path": "aider/main.py", "pattern": "/^    status = main()$/", "kind": "variable"}')
>>>>>>> UPDATED
```

Now the JSON string is on one line in the `test_check_for_ctags_success` method.
2023-05-28 22:19:44 -07:00
Paul Gauthier
346eb7a834 aider: Replaced string with bytes object in test_check_for_ctags_success to fix 'decode' method issue.
# Context:
USER: running test_check_for_ctags_success i get: tests/test_repomap.py 'str' object has no attribute 'decode'
ASSISTANT: It seems like the issue is with the `decode` method being called on a string object. I'll fix this issue for you. Here's the change you need to make in the `tests/test_repomap.py` file:

```python
tests/test_repomap.py
<<<<<<< ORIGINAL
            mock_run.return_value = CompletedProcess(args=["ctags", "--version"], returncode=0, stdout='''{
  "_type": "tag",
  "name": "status",
  "path": "aider/main.py",
  "pattern": "/^    status = main()$/",
  "kind": "variable"
}''')
=======
            mock_run.return_value = CompletedProcess(args=["ctags", "--version"], returncode=0, stdout=b'''{
  "_type": "tag",
  "name": "status",
  "path": "aider/main.py",
  "pattern": "/^    status = main()$/",
  "kind": "variable"
}''')
>>>>>>> UPDATED
```

This change replaces the string with a bytes object, so the `decode` method can be called without any issues.
2023-05-28 22:18:18 -07:00
Paul Gauthier
f5de27ccdd aider: Updated test_check_for_ctags_success to return valid JSON output for get_tags.
# Context:
USER: the output of the subprocess.run needs to be valid json like this:

{
  "_type": "tag",
  "name": "status",
  "path": "aider/main.py",
  "pattern": "/^    status = main()$/",
  "kind": "variable"
}

ASSISTANT: To update the test `test_check_for_ctags_success` to return valid JSON output for `get_tags`, modify the `tests/test_repomap.py` file. Here's the change:

```python
tests/test_repomap.py
<<<<<<< ORIGINAL
    def test_check_for_ctags_success(self):
        with patch("subprocess.run") as mock_run:
            mock_run.return_value = CompletedProcess(args=["ctags", "--version"], returncode=0, stdout="Exuberant Ctags 5.8")
=======
    def test_check_for_ctags_success(self):
        with patch("subprocess.run") as mock_run:
            mock_run.return_value = CompletedProcess(args=["ctags", "--version"], returncode=0, stdout='''{
  "_type": "tag",
  "name": "status",
  "path": "aider/main.py",
  "pattern": "/^    status = main()$/",
  "kind": "variable"
}''')
>>>>>>> UPDATED
```

This change updates the `stdout` value of the `CompletedProcess` object to return valid JSON output as specified. After making this change, run the tests again to ensure they pass.
2023-05-28 17:09:45 -07:00
Paul Gauthier
c2e8fee3d9 aider: Import CompletedProcess from the subprocess module to fix NameError in test_check_for_ctags_success.
# Context:
USER: pytest tests/test_repomap.py
ASSISTANT: I'm an AI language model and cannot execute commands directly. However,
^C KeyboardInterrupt
USER: I ran this command:

 pytest tests/test_repomap.py

And got 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 5 items

tests/test_repomap.py .F...                                              [100%]

=================================== FAILURES ===================================
___________________ TestRepoMap.test_check_for_ctags_success ___________________

self = <tests.test_repomap.TestRepoMap testMethod=test_check_for_ctags_success>

    def test_check_for_ctags_success(self):
        with patch("subprocess.run") as mock_run:
>           mock_run.return_value = CompletedProcess(args=["ctags", "--version"], returncode=0, stdout="Exuberant Ctags 5.8")
E           NameError: name 'CompletedProcess' is not defined

tests/test_repomap.py:67: NameError
=========================== short test summary info ============================
FAILED tests/test_repomap.py::TestRepoMap::test_check_for_ctags_success - Nam...
========================= 1 failed, 4 passed in 0.43s ==========================

ASSISTANT: It looks like there's a `NameError` because `CompletedProcess` is not defined. To fix this, you need to import `CompletedProcess` from the `subprocess` module. Here's the change:

```python
tests/test_repomap.py
<<<<<<< ORIGINAL
from unittest.mock import patch
=======
from unittest.mock import patch
from subprocess import CompletedProcess
>>>>>>> UPDATED
```

This change imports `CompletedProcess` from the `subprocess` module, which should resolve the `NameError`. After making this change, try running the tests again.
2023-05-28 17:08:28 -07:00
Paul Gauthier
6ead145c17 aider: Added test method test_check_for_ctags_success that patches subprocess.run to return a CompletedProcess object with a successful return code and sensible output, and checks if check_for_ctags returns True.
# Context:
USER: add another like that, but the patched subprocess should return sensible output for get_tags
ASSISTANT: To add another test for `check_for_ctags` that patches `subprocess` to return sensible output for `get_tags`, we'll modify the `tests/test_repomap.py` file. We'll use the `unittest.mock` library to patch the `subprocess.run` function to simulate a successful execution.

Here's the change:

```python
tests/test_repomap.py
<<<<<<< ORIGINAL
    def test_get_tags_map_without_ctags(self):
=======
    def test_check_for_ctags_success(self):
        with patch("subprocess.run") as mock_run:
            mock_run.return_value = CompletedProcess(args=["ctags", "--version"], returncode=0, stdout="Exuberant Ctags 5.8")
            repo_map = RepoMap(use_ctags=True)
            result = repo_map.check_for_ctags()
            self.assertTrue(result)

    def test_get_tags_map_without_ctags(self):
>>>>>>> UPDATED
```

This adds a new test method `test_check_for_ctags_success` that patches `subprocess.run` to return a `CompletedProcess` object with a successful return code and sensible output. The test then checks if `check_for_ctags` returns `True`.
2023-05-28 17:07:49 -07:00
Paul Gauthier
8b3b4a2e26 Added import of unittest.mock to test_repomap.py. 2023-05-28 17:07:05 -07:00
Paul Gauthier
f2a116e0e1 aider: Added test method test_check_for_ctags_failure that patches subprocess.run to raise an exception, simulating a failure, and checks if check_for_ctags returns False.
# Context:
USER: in tests/test_repomap.py add a test for check_for_ctags which patches subprocess to fail. check_for_ctags should return false
ASSISTANT: To add a test for `check_for_ctags` that patches `subprocess` to fail, we'll modify the `tests/test_repomap.py` file. We'll use the `unittest.mock` library to patch the `subprocess.run` function to simulate a failure.

Here's the change:

```python
tests/test_repomap.py
<<<<<<< ORIGINAL
    def test_get_tags_map_without_ctags(self):
=======
    from unittest.mock import patch

    def test_check_for_ctags_failure(self):
        with patch("subprocess.run") as mock_run:
            mock_run.side_effect = Exception("ctags not found")
            repo_map = RepoMap(use_ctags=True)
            result = repo_map.check_for_ctags()
            self.assertFalse(result)

    def test_get_tags_map_without_ctags(self):
>>>>>>> UPDATED
```

This adds a new test method `test_check_for_ctags_failure` that patches `subprocess.run` to raise an exception, simulating a failure. The test then checks if `check_for_ctags` returns `False`.
2023-05-28 17:06:09 -07:00
Paul Gauthier
e78ea4299f removed test 2023-05-28 17:04:15 -07:00
Paul Gauthier
3b23efa4d8 aider: Changed test_main_with_ctags_mocked_failure to run within a temporary directory.
# Context:
USER: we need to cwd into a temp dir before the test
ASSISTANT: To change the working directory to a temporary directory before running the test, you can use the `tempfile.TemporaryDirectory()` context manager in the `test_main_with_ctags_mocked_failure` method. Here's the updated code for `tests/test_main.py`:

```python
tests/test_main.py
<<<<<<< ORIGINAL
    def test_main_with_ctags_mocked_failure(self):
        with patch("subprocess.run", side_effect=subprocess.CalledProcessError(1, "ctags")):
            with patch("aider.main.Coder") as MockCoder:
                main(["--ctags"])
                _, kwargs = MockCoder.call_args
                assert kwargs["use_ctags"] is False
=======
    def test_main_with_ctags_mocked_failure(self):
        with tempfile.TemporaryDirectory() as temp_dir:
            os.chdir(temp_dir)
            with patch("subprocess.run", side_effect=subprocess.CalledProcessError(1, "ctags")):
                with patch("aider.main.Coder") as MockCoder:
                    main(["--ctags"])
                    _, kwargs = MockCoder.call_args
                    assert kwargs["use_ctags"] is False
>>>>>>> UPDATED
```

This change will ensure that the test is run within a temporary directory.
2023-05-28 17:01:06 -07:00
Paul Gauthier
640479dafb aider: Added a test to tests/test_main.py that runs with --ctags but mocks subprocess to fail, asserting that coder.use_ctags is false.
# Context:
USER: add a test to tests/test_main.py that runs with --ctags but mocks subprocess to fail. assert that coder.use_ctags is false
ASSISTANT: To add a test that runs with `--ctags` but mocks `subprocess` to fail, you can follow these steps:

1. Import `subprocess` at the beginning of the `tests/test_main.py` file.
2. Add a new test method called `test_main_with_ctags_mocked_failure` to the `TestMain` class.
3. In the new test method, use the `unittest.mock.patch` context manager to mock the `subprocess.run` function to raise a `subprocess.CalledProcessError` exception.
4. Inside the context manager, call the `main` function with the `--ctags` argument.
5. Assert that `coder.use_ctags` is `False`.

Here's the code change for `tests/test_main.py`:

```python
tests/test_main.py
<<<<<<< ORIGINAL
import os
import tempfile
from unittest import TestCase
from unittest.mock import patch
from aider.main import main
=======
import os
import tempfile
import subprocess
from unittest import TestCase
from unittest.mock import patch
from aider.main import main
>>>>>>> UPDATED
```

```python
tests/test_main.py
<<<<<<< ORIGINAL
            with patch("aider.main.Coder") as MockCoder:
                main(["--dirty-commits"])
                _, kwargs = MockCoder.call_args
                assert kwargs["dirty_commits"] is True
=======
            with patch("aider.main.Coder") as MockCoder:
                main(["--dirty-commits"])
                _, kwargs = MockCoder.call_args
                assert kwargs["dirty_commits"] is True

    def test_main_with_ctags_mocked_failure(self):
        with patch("subprocess.run", side_effect=subprocess.CalledProcessError(1, "ctags")):
            with patch("aider.main.Coder") as MockCoder:
                main(["--ctags"])
                _, kwargs = MockCoder.call_args
                assert kwargs["use_ctags"] is False
>>>>>>> UPDATED
```

This will add the requested test to `tests/test_main.py`.
2023-05-28 16:59:41 -07:00
Paul Gauthier
130385584a copy 2023-05-28 14:28:22 -07:00
Paul Gauthier
ce656425a9 copy 2023-05-28 14:26:57 -07:00
Paul Gauthier
d129458a9d copy 2023-05-28 14:11:18 -07:00
Paul Gauthier
2b4fa34415 copy 2023-05-28 13:59:45 -07:00
Paul Gauthier
718797c291 copy 2023-05-28 13:46:54 -07:00
Paul Gauthier
bde4fa71e0 copy 2023-05-28 13:43:30 -07:00
Paul Gauthier
32349098b5 copy 2023-05-28 12:38:14 -07:00
Paul Gauthier
37e3e561f0 Fixed /run output to log 2023-05-28 11:20:08 -07:00
Paul Gauthier
67a1d7231c aider: Updated cmd_run method to ask for user approval before adding the output to the chat.
# Context:
USER: the /run command should emit the lines as tool_output if the user approves adding it to the chat
ASSISTANT: To implement this feature, we need to modify the `aider/commands.py` file. Specifically, we will update the `cmd_run` method to ask for user approval before adding the output to the chat.

Please make the `aider/commands.py` file *read-write* so I can provide the necessary changes.
USER: I added these *read-write* files: aider/commands.py
ASSISTANT: Great! Now, I will provide the necessary changes to the `aider/commands.py` file to implement the requested feature.

```python
aider/commands.py
<<<<<<< ORIGINAL
        print(combined_output)

        ok = self.io.confirm_ask("Add the output to the chat?", default="y")
        if not ok:
            return

        msg = prompts.run_output.format(
            command=args,
            output=combined_output,
        )
        return msg
=======
        if self.io.confirm_ask("Add the output to the chat?", default="y"):
            msg = prompts.run_output.format(
                command=args,
                output=combined_output,
            )
            self.io.tool_output(msg, log_only=False)
        else:
            print(combined_output)
>>>>>>> UPDATED
```

This change will ask the user for approval before adding the output to the chat. If the user approves, it will use `tool_output` to emit the lines, otherwise, it will just print the output.
2023-05-28 11:16:08 -07:00
Paul Gauthier
52d537629b copy 2023-05-28 11:09:26 -07:00
Paul Gauthier
cee56ca17c Changed table of contents and updated example transcripts. 2023-05-28 11:07:58 -07:00
Paul Gauthier
c0733fe9fd aider: Added a Table of Contents just before the "Example chat transcripts" section.
# Context:
USER: add a toc just before Features
ASSISTANT: ```markdown
README.md
<<<<<<< ORIGINAL
* [**Hello World Flask App**](https://aider.chat/examples/hello-world-flask.html): Start from scratch and have GPT create a simple Flask app with various endpoints, such as adding two numbers and calculating the Fibonacci sequence.

* [**Javascript Game Modification**](https://aider.chat/examples/2048-game.html): Dive
^C KeyboardInterrupt
USER: add a toc just before the transcripts section
ASSISTANT: ```markdown
README.md
<<<<<<< ORIGINAL
* [**Hello World Flask App**](https://aider.chat/examples/hello-world-flask.html): Start from scratch and have GPT create a simple Flask app with various endpoints, such as adding two numbers and calculating the Fibonacci sequence.

* [**Javascript Game Modification**](https://aider.chat/examples/2048-game.html): Dive
=======
## Table of Contents

- [Example chat transcripts](#example-chat-transcripts)
- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Chat commands](#chat-commands)
- [Tips](#tips)
- [Limitations](#limitations)

## Example chat transcripts

* [**Hello World Flask App**](https://aider.chat/examples/hello-world-flask.html): Start from scratch and have GPT create a simple Flask app with various endpoints, such as adding two numbers and calculating the Fibonacci sequence.

* [**Javascript Game Modification**](https://aider.chat/examples/2048-game.html): Dive
>>>>>>> UPDATED
```

I've added a Table of Contents just before the "Example chat transcripts" section.
2023-05-28 11:06:16 -07:00
Paul Gauthier
b47efa2ed9 copy 2023-05-28 11:04:00 -07:00
Paul Gauthier
d2284447c3 Only no_color, not force_term 2023-05-28 06:12:06 -07:00
Paul Gauthier
6e57507364 copy 2023-05-27 20:47:09 -07:00
Paul Gauthier
7acb65528b copy 2023-05-27 20:43:18 -07:00
Paul Gauthier
f683e76332 copy 2023-05-27 18:10:45 -07:00
Paul Gauthier
52a9df5b34 aider: Added a test function to check if the pretty attribute of the InputOutput class is set to False when the NO_COLOR environment variable is set.
# Context:
USER: add a test for NO_COLOR
ASSISTANT: To add a test for the `NO_COLOR` environment variable, we will create a new test function in the `tests/test_io.py` file. Since this file does not exist, we will create it first.

```python
tests/test_io.py
<<<<<<< ORIGINAL
=======
import os
import unittest
from unittest.mock import patch
from aider.io import InputOutput

class TestInputOutput(unittest.TestCase):
    def test_no_color_environment_variable(self):
        with patch.dict(os.environ, {"NO_COLOR": "1"}):
            io = InputOutput()
            self.assertFalse(io.pretty)

if __name__ == "__main__":
    unittest.main()
>>>>>>> UPDATED
```

This test function checks if the `pretty` attribute of the `InputOutput` class is set to `False` when the `NO_COLOR` environment variable is set.
2023-05-27 18:07:52 -07:00
Paul Gauthier
9ce90d059a copy 2023-05-27 18:04:05 -07:00
Paul Gauthier
4b8fff69cb copy 2023-05-27 18:01:58 -07:00
Paul Gauthier
321824299a aider: Added check for NO_COLOR environment variable to disable ANSI color.
# Context:
USER: Command-line software which adds ANSI color to its output by default should check for a NO_COLOR environment variable that, when present and not an empty string (regardless of its value), prevents the addition of ANSI color.
ASSISTANT: To implement this feature, we need to modify the `aider/io.py` file. Please make it *read-write* so I can provide the necessary changes.
USER: I added these *read-write* files: aider/io.py
ASSISTANT: Great! Now, I will make the necessary changes to check for the `NO_COLOR` environment variable and disable ANSI color when it is present and not an empty string.

```python
aider/io.py
<<<<<<< ORIGINAL
import os
=======
import os
import os.path
>>>>>>> UPDATED
```

```python
aider/io.py
<<<<<<< ORIGINAL
    def __init__(
        self,
        pretty=True,
        yes=False,
        input_history_file=None,
        chat_history_file=None,
        input=None,
        output=None,
        user_input_color="blue",
        tool_output_color=None,
        tool_error_color="red",
    ):
        self.user_input_color = user_input_color
        self.tool_output_color = tool_output_color
        self.tool_error_color = tool_error_color
        self.input = input
        self.output = output
        self.pretty = pretty
        self.yes = yes
        self.input_history_file = input_history_file
        if chat_history_file is not None:
            self.chat_history_file = Path(chat_history_file)
        else:
            self.chat_history_file = None

        if pretty:
            self.console = Console()
        else:
            self.console = Console(force_terminal=True, no_color=True)
=======
    def __init__(
        self,
        pretty=True,
        yes=False,
        input_history_file=None,
        chat_history_file=None,
        input=None,
        output=None,
        user_input_color="blue",
        tool_output_color=None,
        tool_error_color="red",
    ):
        no_color = os.environ.get("NO_COLOR")
        if no_color is not None and no_color != "":
            pretty = False

        self.user_input_color = user_input_color if pretty else None
        self.tool_output_color = tool_output_color if pretty else None
        self.tool_error_color = tool_error_color if pretty else None
        self.input = input
        self.output = output
        self.pretty = pretty
        self.yes = yes
        self.input_history_file = input_history_file
        if chat_history_file is not None:
            self.chat_history_file = Path(chat_history_file)
        else:
            self.chat_history_file = None

        self.console = Console(force_terminal=not pretty, no_color=not pretty)
>>>>>>> UPDATED
```

These changes will make the software check for the `NO_COLOR` environment variable and disable ANSI color when it is present and not an empty string.
2023-05-27 17:57:32 -07:00
Paul Gauthier
ffaa28cb7b new gif 2023-05-27 17:34:25 -07:00
Paul Gauthier
80bf696428 new gif 2023-05-27 17:31:02 -07:00
Paul Gauthier
3dacaf65b1 copy 2023-05-27 17:28:28 -07:00
Paul Gauthier
cd735f243b new gif 2023-05-27 17:13:05 -07:00
Paul Gauthier
bd78789bd2 Fixed quote stripping of gpt3.5 commit messages 2023-05-27 17:05:57 -07:00
Paul Gauthier
3d8ecddb3f aider: Added a test method to check if get_commit_message returns the expected message when send method is mocked.
# Context:
USER: add a test for get_commit_message that passes in a dummy diff and context string. mock coder.send to return "a good commit message",False. assert that is the message returned by get_commit_message
ASSISTANT: I will add a new test method called `test_get_commit_message` in the `tests/test_coder.py` file.

```python
tests/test_coder.py
<<<<<<< ORIGINAL

if __name__ == "__main__":
    unittest.main()
=======
    def test_get_commit_message(self):
        # Mock the IO object
        mock_io = MagicMock()

        # Initialize the Coder object with the mocked IO and mocked repo
        coder = Coder(io=mock_io, openai_api_key="fake_key")

        # Mock the send method to return a tuple with a message and False
        coder.send = MagicMock(return_value=("a good commit message", False))

        # Call the get_commit_message method with dummy diff and context
        result = coder.get_commit_message("dummy diff", "dummy context")

        # Assert that the returned message is the expected one
        self.assertEqual(result, "a good commit message")

if __name__ == "__main__":
    unittest.main()
>>>>>>> UPDATED
```

This new test method mocks the `send` method of the `Coder` object to return a predefined commit message and checks if the `get_commit_message` method returns the expected message.
2023-05-27 17:03:27 -07:00
Paul Gauthier
41222d9c1f new gif 2023-05-27 16:55:46 -07:00
Paul Gauthier
b0ba9cdaa1 new gif 2023-05-27 16:35:07 -07:00
Paul Gauthier
fb2cedb043 new gif 2023-05-27 16:31:48 -07:00
Paul Gauthier
e3f34d710c moved screenshots to assets 2023-05-27 16:31:07 -07:00
Paul Gauthier
2ec6757f86 aider: Added new arguments --user-input-color, --tool-output-color, and --tool-error-color to main function and passed them to InputOutput class.
# Context:
USER: add args --user-input-color default green, --tool-output-color default None and --tool-error-color default red. pass them to InputOutput
ASSISTANT: I will add the new arguments to the `main` function and pass them to the `InputOutput` class.

```python
aider/main.py
<<<<<<< ORIGINAL
    parser.add_argument(
        "--pretty",
        action="store_true",
        default=True,
        help="Enable pretty, colorized output (default: True)",
    )
    parser.add_argument(
        "--no-pretty",
        action="store_false",
        dest="pretty",
        help="Disable pretty, colorized output",
    )
=======
    parser.add_argument(
        "--pretty",
        action="store_true",
        default=True,
        help="Enable pretty, colorized output (default: True)",
    )
    parser.add_argument(
        "--no-pretty",
        action="store_false",
        dest="pretty",
        help="Disable pretty, colorized output",
    )
    parser.add_argument(
        "--user-input-color",
        default="green",
        help="Set the color for user input (default: green)",
    )
    parser.add_argument(
        "--tool-output-color",
        default=None,
        help="Set the color for tool output (default: None)",
    )
    parser.add_argument(
        "--tool-error-color",
        default="red",
        help="Set the color for tool error messages (default: red)",
    )
>>>>>>> UPDATED
```

```python
aider/main.py
<<<<<<< ORIGINAL
    io = InputOutput(
        args.pretty,
        args.yes,
        args.input_history_file,
        args.chat_history_file,
        input=input,
        output=output,
    )
=======
    io = InputOutput(
        args.pretty,
        args.yes,
        args.input_history_file,
        args.chat_history_file,
        input=input,
        output=output,
        user_input_color=args.user_input_color,
        tool_output_color=args.tool_output_color,
        tool_error_color=args.tool_error_color,
    )
>>>>>>> UPDATED
```

Now the new arguments are added and passed to the `InputOutput` class.
2023-05-27 15:21:57 -07:00
Paul Gauthier
0fa660066f color the hrule 2023-05-27 15:19:53 -07:00
Paul Gauthier
70b912250a rename 2023-05-27 15:18:31 -07:00
Paul Gauthier
b8e480d699 rename 2023-05-27 15:18:13 -07:00
Paul Gauthier
cc9b21df06 renamed io.tool() -> io.tool_output() 2023-05-27 15:17:33 -07:00
Paul Gauthier
f6d07d9849 Accept colors for various prompts 2023-05-27 15:14:56 -07:00
Paul Gauthier
03cc679a5b aider: Added tool_color and tool_error_color properties to InputOutput class and updated style and console print accordingly.
# Context:
USER: move the red and green colors for tool and tool_error into self. properties. add args to init with red and green defaults.
ASSISTANT: To make the changes, I will modify the `aider/io.py` file. Here are the changes:

```python
aider/io.py
<<<<<<< ORIGINAL
class InputOutput:
    def __init__(
        self,
        pretty=True,
        yes=False,
        input_history_file=None,
        chat_history_file=None,
        input=None,
        output=None,
    ):
=======
class InputOutput:
    def __init__(
        self,
        pretty=True,
        yes=False,
        input_history_file=None,
        chat_history_file=None,
        input=None,
        output=None,
        tool_color="green",
        tool_error_color="red",
    ):
        self.tool_color = tool_color
        self.tool_error_color = tool_error_color
>>>>>>> UPDATED
```

```python
aider/io.py
<<<<<<< ORIGINAL
        style = Style.from_dict({"": "green"})
=======
        style = Style.from_dict({"": self.tool_color})
>>>>>>> UPDATED
```

```python
aider/io.py
<<<<<<< ORIGINAL
        self.console.print(message, style="red")
=======
        self.console.print(message, style=self.tool_error_color)
>>>>>>> UPDATED
```
2023-05-27 14:54:04 -07:00
Paul Gauthier
387477d5c2 try running all tests w/ctags 2023-05-27 14:16:58 -07:00
Paul Gauthier
a84f93b9e4 aider: Added step to install "universal ctags" before installing Python dependencies.
# Context:
USER: i need to install the "universal ctags" binary in ubuntu before i run tests
ASSISTANT: To install the "universal ctags" binary in Ubuntu before running tests, you can add a new step in the `.github/workflows/python-tests.yml` file.

```yaml
.github/workflows/python-tests.yml
<<<<<<< ORIGINAL
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install -r requirements.txt
=======
    - name: Install universal ctags
      run: |
        sudo apt-get update
        sudo apt-get install -y universal-ctags

    - name: Install dependencies
      run: |
        python
^C KeyboardInterrupt
USER: sorry, do that again
ASSISTANT: Sure, here's the updated step to install "universal ctags" in the `.github/workflows/python-tests.yml` file.

```yaml
.github/workflows/python-tests.yml
<<<<<<< ORIGINAL
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install -r requirements.txt
=======
    - name: Install universal ctags
      run: |
        sudo apt-get update
        sudo apt-get install -y universal-ctags

    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install -r requirements.txt
>>>>>>> UPDATED
```

This change adds a new step to install "universal ctags" before installing the Python dependencies.
2023-05-27 14:16:41 -07:00