mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-23 22:04:59 +00:00
aider: Added auto_commits
as a new argument to the Coder()
class and updated main()
function to pass the argument.
# Context: USER: add auto_commits as a new arg to Coder(). assign it to self.auto_commit ASSISTANT: To add `auto_commits` as a new argument to the `Coder()` class and assign it to `self.auto_commit`, you need to update the `__init__` method in the `aider/coder.py` file: ```python aider/coder.py <<<<<<< ORIGINAL def __init__(self, main_model, fnames, pretty, history_file, show_diffs): ======= def __init__(self, main_model, fnames, pretty, history_file, show_diffs, auto_commits): >>>>>>> UPDATED self.history_file = history_file # ... (rest of the code remains unchanged) self.show_diffs = show_diffs <<<<<<< ORIGINAL ======= self.auto_commit = auto_commits >>>>>>> UPDATED ``` Then, update the `main()` function in the `aider/main.py` file to pass the `auto_commits` argument when creating a new `Coder` instance: ```python aider/main.py <<<<<<< ORIGINAL coder = Coder(args.model, fnames, pretty, args.history_file, args.show_diffs) ======= coder = Coder(args.model, fnames, pretty, args.history_file, args.show_diffs, args.auto_commits) >>>>>>> UPDATED coder.commit(ask=True, prefix="wip: ", which="repo_files") # ... (rest of the code remains unchanged) ```
This commit is contained in:
parent
8bcbc5b0de
commit
b018eade37
2 changed files with 2 additions and 2 deletions
|
@ -33,7 +33,7 @@ class Coder:
|
|||
repo = None
|
||||
last_aider_commit_hash = None
|
||||
|
||||
def __init__(self, main_model, fnames, pretty, history_file, show_diffs):
|
||||
def __init__(self, main_model, fnames, pretty, history_file, show_diffs, auto_commits):
|
||||
self.history_file = history_file
|
||||
|
||||
if pretty:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue