mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-03 19:24:59 +00:00
removed dotenv
This commit is contained in:
parent
1fb1765b38
commit
139a141be9
2 changed files with 7 additions and 28 deletions
|
@ -20,8 +20,6 @@ def main(args=None, input=None, output=None):
|
||||||
|
|
||||||
git_root = get_git_root()
|
git_root = get_git_root()
|
||||||
|
|
||||||
env_prefix = "AIDER_"
|
|
||||||
|
|
||||||
default_config_files = [
|
default_config_files = [
|
||||||
os.path.expanduser("~/.aider.conf.yml"),
|
os.path.expanduser("~/.aider.conf.yml"),
|
||||||
]
|
]
|
||||||
|
@ -33,6 +31,7 @@ def main(args=None, input=None, output=None):
|
||||||
add_config_file_help=True,
|
add_config_file_help=True,
|
||||||
default_config_files=default_config_files,
|
default_config_files=default_config_files,
|
||||||
config_file_parser_class=configargparse.YAMLConfigFileParser,
|
config_file_parser_class=configargparse.YAMLConfigFileParser,
|
||||||
|
auto_env_var_prefix="AIDER_",
|
||||||
)
|
)
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
|
@ -62,21 +61,18 @@ def main(args=None, input=None, output=None):
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--input-history-file",
|
"--input-history-file",
|
||||||
metavar="INPUT_HISTORY_FILE",
|
metavar="INPUT_HISTORY_FILE",
|
||||||
env_var=f"{env_prefix}INPUT_HISTORY_FILE",
|
|
||||||
default=default_input_history_file,
|
default=default_input_history_file,
|
||||||
help=f"Specify the chat input history file (default: {default_input_history_file})",
|
help=f"Specify the chat input history file (default: {default_input_history_file})",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--chat-history-file",
|
"--chat-history-file",
|
||||||
metavar="CHAT_HISTORY_FILE",
|
metavar="CHAT_HISTORY_FILE",
|
||||||
env_var=f"{env_prefix}CHAT_HISTORY_FILE",
|
|
||||||
default=default_chat_history_file,
|
default=default_chat_history_file,
|
||||||
help=f"Specify the chat history file (default: {default_chat_history_file})",
|
help=f"Specify the chat history file (default: {default_chat_history_file})",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--model",
|
"--model",
|
||||||
metavar="MODEL",
|
metavar="MODEL",
|
||||||
env_var=f"{env_prefix}MODEL",
|
|
||||||
default="gpt-4",
|
default="gpt-4",
|
||||||
help="Specify the model to use for the main chat (default: gpt-4)",
|
help="Specify the model to use for the main chat (default: gpt-4)",
|
||||||
)
|
)
|
||||||
|
@ -90,7 +86,6 @@ def main(args=None, input=None, output=None):
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--pretty",
|
"--pretty",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
env_var=f"{env_prefix}PRETTY",
|
|
||||||
default=True,
|
default=True,
|
||||||
help="Enable pretty, colorized output (default: True)",
|
help="Enable pretty, colorized output (default: True)",
|
||||||
)
|
)
|
||||||
|
@ -108,7 +103,6 @@ def main(args=None, input=None, output=None):
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--auto-commits",
|
"--auto-commits",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
env_var=f"{env_prefix}AUTO_COMMIT",
|
|
||||||
dest="auto_commits",
|
dest="auto_commits",
|
||||||
default=True,
|
default=True,
|
||||||
help="Enable auto commit of changes (default: True)",
|
help="Enable auto commit of changes (default: True)",
|
||||||
|
@ -120,20 +114,19 @@ def main(args=None, input=None, output=None):
|
||||||
dest="auto_commits",
|
dest="auto_commits",
|
||||||
help="Disable auto commit of changes",
|
help="Disable auto commit of changes",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
|
||||||
"--no-dirty-commits",
|
|
||||||
action="store_false",
|
|
||||||
dest="dirty_commits",
|
|
||||||
help="Disable dirty commit of changes",
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--dirty-commits",
|
"--dirty-commits",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
dest="dirty_commits",
|
dest="dirty_commits",
|
||||||
help="Enable dirty commit of changes",
|
help="Enable dirty commit of changes",
|
||||||
env_var=f"{env_prefix}DIRTY_COMMIT",
|
|
||||||
default=True,
|
default=True,
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--no-dirty-commits",
|
||||||
|
action="store_false",
|
||||||
|
dest="dirty_commits",
|
||||||
|
help="Disable dirty commit of changes",
|
||||||
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--dry-run",
|
"--dry-run",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
|
@ -143,7 +136,6 @@ def main(args=None, input=None, output=None):
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--show-diffs",
|
"--show-diffs",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
env_var=f"{env_prefix}SHOW_DIFFS",
|
|
||||||
help="Show diffs when committing changes (default: False)",
|
help="Show diffs when committing changes (default: False)",
|
||||||
default=False,
|
default=False,
|
||||||
)
|
)
|
||||||
|
@ -153,7 +145,6 @@ def main(args=None, input=None, output=None):
|
||||||
nargs="?",
|
nargs="?",
|
||||||
const=True,
|
const=True,
|
||||||
default=None,
|
default=None,
|
||||||
env_var=f"{env_prefix}CTAGS",
|
|
||||||
help=(
|
help=(
|
||||||
"Add ctags to the chat to help GPT understand the codebase (default: check for ctags"
|
"Add ctags to the chat to help GPT understand the codebase (default: check for ctags"
|
||||||
" executable)"
|
" executable)"
|
||||||
|
|
|
@ -74,15 +74,3 @@ class TestMain(TestCase):
|
||||||
main(["--dirty-commits"])
|
main(["--dirty-commits"])
|
||||||
_, kwargs = MockCoder.call_args
|
_, kwargs = MockCoder.call_args
|
||||||
assert kwargs["dirty_commits"] is True
|
assert kwargs["dirty_commits"] is True
|
||||||
|
|
||||||
|
|
||||||
def test_main_pretty_from_env(self):
|
|
||||||
with tempfile.TemporaryDirectory() as temp_dir:
|
|
||||||
os.chdir(temp_dir)
|
|
||||||
with open(".env", "w") as env_file:
|
|
||||||
env_file.write("AIDER_PRETTY=false\n")
|
|
||||||
|
|
||||||
with patch("aider.main.Coder") as MockCoder:
|
|
||||||
main([])
|
|
||||||
_, kwargs = MockCoder.call_args
|
|
||||||
assert kwargs["pretty"] is False
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue