From 7f028eeb1e6522286705a4cd8d879ef625673128 Mon Sep 17 00:00:00 2001 From: "Your Name (aider)" Date: Sun, 28 Jul 2024 19:23:23 -0300 Subject: [PATCH] Replace `valid_formats` with dynamically generated list of `coder.__all__` entries with `edit_format` attribute --- aider/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/commands.py b/aider/commands.py index 897899cbb..bf957e69f 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -48,7 +48,7 @@ class Commands: "Switch to a new editing mode" ef = args.strip() - valid_formats = "diff udiff whole".split() + valid_formats = [coder.__name__ for coder in self.coder.__all__ if hasattr(coder, 'edit_format')] if ef not in valid_formats: self.io.tool_error(