Commit graph

376 commits

Author SHA1 Message Date
Paul Gauthier
9d2f89dd75 fix test 2023-12-06 09:30:19 -08:00
Paul Gauthier
922a56b194 Merge branch 'main' into openai-upgrade 2023-12-06 09:26:05 -08:00
Paul Gauthier
57ab2cc9da Revert "implement deployment id"
This reverts commit b107db98fa.
2023-12-06 09:20:53 -08:00
Your Name
4692a689fe Improvements: flag -f (not -mf); unitest improvements. 2023-12-05 23:55:10 +01:00
Your Name
13ac5f0b60 Add --message-file flag and unit test
This commit introduces the `--message-file` flag to the `aider` tool, allowing users to specify a file containing the message to send to GPT. This feature processes the reply and then exits, disabling the chat mode. The implementation includes reading the content of the specified file and using it as the prompt message.

Additionally, a unit test has been added to `tests/test_main.py` to ensure the correct functionality of the `--message-file` flag. The test includes necessary mocks to handle non-interactive environments and verifies that the tool behaves as expected when a message file is provided.

This enhancement improves the usability of the `aider` tool for users who prefer or require non-interactive execution, such as in scripting or automated workflows.
2023-12-05 23:55:10 +01:00
Paul Gauthier
b107db98fa implement deployment id 2023-12-05 11:31:17 -08:00
Paul Gauthier
d92a93221c fixed test_wholefile 2023-12-05 11:11:48 -08:00
Paul Gauthier
5b21d5704a fixed test_sendchat 2023-12-05 11:08:14 -08:00
Paul Gauthier
a68d3d8a20 fixed test_models 2023-12-05 10:56:03 -08:00
Paul Gauthier
23e6c4ee55 fixed test_coder 2023-12-05 10:51:50 -08:00
Paul Gauthier
fb07b784f6 move to gpt-3.5-turbo-1106 2023-12-05 10:28:27 -08:00
Paul Gauthier
6ebc142377 roughed in openai 1.x 2023-12-05 07:37:05 -08:00
Your Name
3e81cb1c6b Fixes #374 - test_main.py += unit test for --message flag.
Fixes https://github.com/paul-gauthier/aider/issues/374
2023-11-30 13:20:22 +01:00
Paul Gauthier
bf6cd8294e handle submodules (or other dirs) which are git tracked #336 2023-11-15 13:34:29 -08:00
Paul Gauthier
d54f883698 do not include added files in the repo map #315 2023-11-15 13:06:22 -08:00
Paul Gauthier
95fe1be4c5 /add and /drop should work on untracked files in a repo (without committing them) 2023-11-15 13:06:22 -08:00
Paul Gauthier
5dd7287ee3 fixed test for windows 2023-11-14 13:19:57 -08:00
Paul Gauthier
6c77c32d06 aider: Refactored test_check_gitignore to use a temporary git config file and set the GIT_CONFIG_GLOBAL environment variable during the test execution.
# Aider chat conversation:

USER: in `test_check_gitignore` can we have gitpython not use the global gitignore?

ASSISTANT: To ensure that GitPython does not use the global gitignore, we can set the `GIT_CONFIG_GLOBAL` environment variable to point to a non-existent file or an empty temporary file during the test execution. This will effectively ignore the global gitignore settings.

We will modify the `test_check_gitignore` method in the `tests/test_main.py` file to set the `GIT_CONFIG_GLOBAL` environment variable before the test runs and reset it after the test is completed.

Here are the *SEARCH/REPLACE* blocks:

tests/test_main.py
```python
<<<<<<< SEARCH
    def test_check_gitignore(self):
        make_repo()
        io = InputOutput(pretty=False, yes=True)
        cwd = Path.cwd()
        gitignore = cwd / ".gitignore"

        self.assertFalse(gitignore.exists())
        check_gitignore(cwd, io)
        self.assertTrue(gitignore.exists())

        self.assertEqual(".aider*", gitignore.read_text().splitlines()[0])

        gitignore.write_text("one\ntwo\n")
        check_gitignore(cwd, io)
        self.assertEqual("one\ntwo\n.aider*\n", gitignore.read_text())
=======
    def test_check_gitignore(self):
        with tempfile.NamedTemporaryFile() as temp_gitconfig:
            os.environ['GIT_CONFIG_GLOBAL'] = temp_gitconfig.name
            make_repo()
            io = InputOutput(pretty=False, yes=True)
            cwd = Path.cwd()
            gitignore = cwd / ".gitignore"

            self.assertFalse(gitignore.exists())
            check_gitignore(cwd, io)
            self.assertTrue(gitignore.exists())

            self.assertEqual(".aider*", gitignore.read_text().splitlines()[0])

            gitignore.write_text("one\ntwo\n")
            check_gitignore(cwd, io)
            self.assertEqual("one\ntwo\n.aider*\n", gitignore.read_text())
            del os.environ['GIT_CONFIG_GLOBAL']
>>>>>>> REPLACE
```

This change will create a temporary file to act as a dummy global git configuration file and set the `GIT_CONFIG_GLOBAL` environment variable to its path. After the test, it will delete the environment variable to avoid affecting other tests or operations.
2023-11-14 13:05:47 -08:00
Paul Gauthier
f3d3815201 Armor AutoCompleter against unicode errors #305 2023-11-03 07:26:21 -07:00
Paul Gauthier
997d7a995d cleanup inside GitTemporaryDirectory 2023-11-02 16:24:28 -07:00
Paul Gauthier
6b3342a150 really cleanup for winsows 2023-11-02 16:20:04 -07:00
Paul Gauthier
a7e89ea965 commit the dirty repo 2023-11-02 16:11:26 -07:00
Paul Gauthier
2e232b1d20 Ignore PermissionError when testing too 2023-11-02 16:07:08 -07:00
Paul Gauthier
d720bfe459 Properly test if /added file is already in the repo #314 2023-11-02 15:50:30 -07:00
Paul Gauthier
2609ec1b06 find_original_update_blocks now accepts fence param, raises on mangled <source>filename.ext #317 2023-11-02 12:05:39 -07:00
Paul Gauthier
6556265c23 added test for #310 2023-11-02 09:45:16 -07:00
paul-gauthier
41435228a3
Update test_commands.py 2023-10-25 16:00:20 -07:00
Paul Gauthier
b6142af12b make sure **.txt does not crash chat #293 2023-10-25 15:52:26 -07:00
Paul Gauthier
95f2b4546e fixed tests 2023-10-25 15:31:23 -07:00
Paul Gauthier
277a92b3c6 fixed tests 2023-10-25 15:30:33 -07:00
Paul Gauthier
3299d90317 Handle successive editblocks from same file w/o filename #267 2023-10-22 11:28:22 -07:00
Paul Gauthier
4654e81241 Merge branch 'main' into sitter-map 2023-10-20 08:05:33 -07:00
Paul Gauthier
6791bc19c6 added test for --encoding 2023-10-20 08:04:02 -07:00
Paul Gauthier
7929e825e7 fixed test 2023-10-19 15:27:51 -07:00
Paul Gauthier
c0375d3328 fix tests; fix off-by-one bug in output of repomap 2023-10-18 15:42:38 -07:00
Paul Gauthier
1085549548 Give up testing aiderignore caching in github actions 2023-10-18 12:28:24 -07:00
Paul Gauthier
df27007c00 wtf 2023-10-18 12:22:01 -07:00
Paul Gauthier
1a2370f9ae sleep in the test 2023-10-18 12:15:11 -07:00
Paul Gauthier
b87c9f14fb put back caching, add debug output 2023-10-18 12:11:07 -07:00
Paul Gauthier
a1cb6e4e7a More paranoid mtime check 2023-10-18 11:55:04 -07:00
Paul Gauthier
2e6c785c3b cache aiderignore 2023-10-18 10:39:07 -07:00
Paul Gauthier
583c3285ec added tests, fixed bug 2023-10-18 10:31:45 -07:00
Paul Gauthier
774589b376 test to ensure we accept abs filenames; use shlex so we handle quoted filenames; #152 #156 2023-09-29 15:02:45 -07:00
Paul Gauthier
d2acb8e95e use a windows compatible regex filename 2023-09-29 14:50:41 -07:00
Paul Gauthier
dc19a1fe4b /add treats args as literal filenames initially, only glob if they do not exist #195 2023-09-29 13:44:49 -07:00
Paul Gauthier
399d86d437 block /add of files from outside coder.root #178 2023-09-29 13:27:43 -07:00
Paul Gauthier
98bacd0b5b test case and fix for /add blowing up in subdir #201 2023-09-29 10:49:27 -07:00
Paul Gauthier
6d5827643f don't try and commit unless there are changes #264 2023-09-25 14:55:00 -07:00
Paul Gauthier
1334392418 lint 2023-09-01 15:53:19 -07:00
Joshua Vial
0826e116da cleaning up openrouter code 2023-08-23 22:03:09 +12:00