aider: Reversed the logic of the --no-auto-commits variable, storing to an "auto_commits" var with default value of True, and updated the environment variable to AUTO_COMMITS in aider/main.py.

# Context:
USER: reverse the logic of the --no-aut-commits variable, so it's storing to an "auto_commits" var. default is true. env is AUTO_COMMITS. but keep the switch as --no-auto-commits
ASSISTANT: To reverse the logic of the `--no-auto-commits` variable, we need to change the variable name to `auto_commits`, set its default value to `True`, and update the environment variable to `AUTO_COMMITS`. Please provide the contents of the file where this variable is defined, so I can suggest the necessary changes.
USER: Please note that I shared content of these additional files: aider/main.py
ASSISTANT: I apologize for the oversight. Here are the changes to reverse the logic of the `--no-auto-commits` variable in the `aider/main.py` file:

```python
aider/main.py
<<<<<<< ORIGINAL
    parser.add_argument(
        "--no-auto-commits",
        action="store_true",
        help=f"Do not automatically commit changes (default: False, ${env_prefix}NO_AUTO_COMMITS)",
        default=bool(int(os.environ.get(f"{env_prefix}NO_AUTO_COMMITS", 0))),
    )
=======
    parser.add_argument(
        "--no-auto-commits",
        action="store_false",
        dest="auto_commits",
        help=f"Do not automatically commit changes (default: True, ${env_prefix}AUTO_COMMITS)",
        default=bool(int(os.environ.get(f"{env_prefix}AUTO_COMMITS", 1))),
    )
>>>>>>> UPDATED
```

This change will store the value of the `--no-auto-commits` flag in the `auto_commits` variable, with a default value of `True`. The environment variable is also updated to `AUTO_COMMITS`.
This commit is contained in:
Paul Gauthier 2023-05-11 15:43:18 -07:00
parent a6d9581e5f
commit 37741bed2a

View file

@ -50,9 +50,10 @@ def main():
)
parser.add_argument(
"--no-auto-commits",
action="store_true",
help=f"Do not automatically commit changes (default: False, ${env_prefix}NO_AUTO_COMMITS)",
default=bool(int(os.environ.get(f"{env_prefix}NO_AUTO_COMMITS", 0))),
action="store_false",
dest="auto_commits",
help=f"Do not automatically commit changes (default: True, ${env_prefix}AUTO_COMMITS)",
default=bool(int(os.environ.get(f"{env_prefix}AUTO_COMMITS", 1))),
)
parser.add_argument(
"--show-diffs",