Commit graph

952 commits

Author SHA1 Message Date
paul-gauthier
64ae53bce3
Update README.md 2023-05-15 06:51:08 -07:00
paul-gauthier
14984487dc
Update default.html 2023-05-15 06:49:45 -07:00
Paul Gauthier
787c75784c copy 2023-05-15 06:09:05 -07:00
Paul Gauthier
dc255eed04 copy 2023-05-15 05:25:06 -07:00
Paul Gauthier
0420459e22 copy 2023-05-15 05:23:58 -07:00
paul-gauthier
6b15cc2ec0
Update css-exercises.md 2023-05-14 21:55:04 -07:00
paul-gauthier
95709bd68c
Update 2048-game.md 2023-05-14 21:54:47 -07:00
Paul Gauthier
f344d26b3d copy 2023-05-14 21:45:34 -07:00
Paul Gauthier
aafd9f519d copy 2023-05-14 21:44:29 -07:00
Paul Gauthier
a31a29bca6 copy 2023-05-14 21:44:12 -07:00
Paul Gauthier
3923aab5f0 copy 2023-05-14 21:40:16 -07:00
Paul Gauthier
44a5cabf85 copy 2023-05-14 21:38:19 -07:00
Paul Gauthier
d66c11ad99 copy 2023-05-14 21:34:46 -07:00
Paul Gauthier
d23c5e29ec copy 2023-05-14 21:33:37 -07:00
Paul Gauthier
1c1cbed33b copy 2023-05-14 21:32:55 -07:00
Paul Gauthier
6f6a3a9dd6 aider: Added screenshot to README.md.
# Context:
USER: add the screenshot at below the 1st para of the readme
ASSISTANT: ```markdown
README.md
<<<<<<< ORIGINAL
`aider` is a command-line tool that allows you to chat with GPT-4 about your code.
Ask GPT for features, improvements, or bug fixes and `aider` will directly apply the suggested changes to your source files.
Each change is automatically committed to git with a descriptive commit message.
=======
`aider` is a command-line tool that allows you to chat with GPT-4 about your code.
Ask GPT for features, improvements, or bug fixes and `aider` will directly apply the suggested changes to your source files.
Each change is automatically committed to git with a descriptive commit message.

![aider screenshot](screenshot.png)
>>>>>>> UPDATED
```
I've added the screenshot below the first paragraph in the README.md file.
2023-05-14 21:26:04 -07:00
Paul Gauthier
2473c40d71 initial 2023-05-14 21:25:17 -07:00
Paul Gauthier
75e1355887 copy 2023-05-14 21:17:00 -07:00
Paul Gauthier
e0500046f7 copy 2023-05-14 21:15:35 -07:00
Paul Gauthier
bf73c71659 copy 2023-05-14 21:14:45 -07:00
Paul Gauthier
481c5f879f copy 2023-05-14 21:12:21 -07:00
Paul Gauthier
c28543debd copy 2023-05-14 21:11:09 -07:00
Paul Gauthier
5ad7253e2a fixed urls 2023-05-14 21:09:59 -07:00
Paul Gauthier
5f99edd4d6 initial 2023-05-14 21:08:30 -07:00
paul-gauthier
c2fd7c4438
Update _config.yml 2023-05-14 19:52:33 -07:00
paul-gauthier
9da6e39b54
Update _config.yml 2023-05-14 19:14:52 -07:00
paul-gauthier
be35cace6d
Update _config.yml 2023-05-14 19:13:00 -07:00
Paul Gauthier
0c83a2b218 copy 2023-05-14 16:48:10 -07:00
Paul Gauthier
9969641a69 copy 2023-05-14 16:45:57 -07:00
Paul Gauthier
2081711660 initial 2023-05-14 16:39:56 -07:00
Paul Gauthier
8c2d01b0b3 copy 2023-05-14 16:21:50 -07:00
Paul Gauthier
967607aba4 copy 2023-05-14 16:21:34 -07:00
Paul Gauthier
6a456cbfd5 copy 2023-05-14 15:13:19 -07:00
Paul Gauthier
bb596db9e4 copy 2023-05-14 15:11:48 -07:00
Paul Gauthier
37a4c47282 Refactor apply_updates method to return edit_error instead of err. 2023-05-14 15:01:50 -07:00
Paul Gauthier
28533ad23e aider: Refactored try/except block around self.update_files() call into a new method called apply_updates(). 2023-05-14 14:57:57 -07:00
Paul Gauthier
3374ae19be wip: Changed prompt messages to use proper grammar and formatting. 2023-05-14 14:54:55 -07:00
Paul Gauthier
ddc8fa6f0b Merge branch 'main' into dotdotdot 2023-05-14 14:50:36 -07:00
Paul Gauthier
c1242bd961 copy 2023-05-14 14:47:56 -07:00
Paul Gauthier
fc7eecdc44 copy 2023-05-14 14:41:17 -07:00
Paul Gauthier
90f9c53480 copy 2023-05-14 14:33:01 -07:00
Paul Gauthier
451f257573 copy 2023-05-14 14:32:12 -07:00
Paul Gauthier
f4cdbbf2e3 copy 2023-05-14 14:25:31 -07:00
Paul Gauthier
7b4c9079c3 copy 2023-05-14 14:24:27 -07:00
Paul Gauthier
5bc835cb31 copy 2023-05-14 14:23:17 -07:00
Paul Gauthier
0c05e3d957 Handle case where part="" and replace is non-empty 2023-05-14 11:07:22 -07:00
Paul Gauthier
e9debe71e8 Attempt to honot edit blocks which elide content using ... 2023-05-14 11:00:45 -07:00
Paul Gauthier
ed138d1940 changed output if dryrun 2023-05-14 10:16:43 -07:00
Paul Gauthier
ab68022fb9 wip: Added a dry-run option to do_replace function. 2023-05-14 10:15:08 -07:00
Paul Gauthier
0b8690654e aider: Added dry_run parameter to do_replace function and passed it from Coder class.
# Context:
USER: pass dry run into do_replace and only write to the file if false
ASSISTANT: To implement this change, we need to modify the `do_replace` function in the `aider/utils.py` file. We will add a new parameter `dry_run` to the function and only write to the file if `dry_run` is `False`.

Here's the change:

```python
aider/utils.py
<<<<<<< ORIGINAL
def do_replace(fname, before_text, after_text):
=======
def do_replace(fname, before_text, after_text, dry_run=False):
>>>>>>> UPDATED
    before_text = strip_quoted_wrapping(before_text, fname)
    after_text = strip_quoted_wrapping(after_text, fname)
    fname = Path(fname)

    # does it want to make a new file?
    if not fname.exists() and not before_text.strip():
        fname.touch()

    content = fname.read_text()

    if not before_text.strip():
        if content:
            new_content = content + after_text
        else:
            # first populating an empty file
            new_content = after_text
    else:
        new_content = replace_most_similar_chunk(content, before_text, after_text)
        if not new_content:
            return

    if not dry_run:
        fname.write_text(new_content)
    return True
```

Now, you need to pass the `dry_run` parameter from the `Coder` class in the `aider/coder.py` file to the `do_replace` function. Here's the change:

```python
aider/coder.py
<<<<<<< ORIGINAL
if utils.do_replace(full_path, original, updated):
=======
if utils.do_replace(full_path, original, updated, self.dry_run):
>>>>>>> UPDATED
    self.io.tool(f"Applied edit to {path}")
else:
    self.io.tool_error(f"Failed to apply edit to {path}")
```

These changes will ensure that the file is only written to when `dry_run` is `False`.
2023-05-14 10:14:20 -07:00