From 12beedd0a6d42e79a51d056652cd98361efd96c1 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 4 Apr 2025 21:40:47 +1300 Subject: [PATCH] style: Run linter to fix line lengths and formatting issues --- aider/main.py | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/aider/main.py b/aider/main.py index e6e070ed5..284ba6694 100644 --- a/aider/main.py +++ b/aider/main.py @@ -772,24 +772,39 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F # Check if an OpenRouter model was selected/specified but the key is missing if args.model.startswith("openrouter/") and not os.environ.get("OPENROUTER_API_KEY"): - io.tool_warning(f"The specified model '{args.model}' requires an OpenRouter API key, which was not found.") + io.tool_warning( + f"The specified model '{args.model}' requires an OpenRouter API key, which was not" + " found." + ) # Attempt OAuth flow because the specific model needs it if offer_openrouter_oauth(io, analytics): # OAuth succeeded, the key should now be in os.environ. # Check if the key is now present after the flow. if os.environ.get("OPENROUTER_API_KEY"): - io.tool_output("OpenRouter successfully connected.") # Inform user connection worked + io.tool_output( + "OpenRouter successfully connected." + ) # Inform user connection worked else: - # This case should ideally not happen if offer_openrouter_oauth succeeded - # but check defensively. - io.tool_error("OpenRouter authentication seemed successful, but the key is still missing.") - analytics.event("exit", reason="OpenRouter key missing after successful OAuth for specified model") - return 1 + # This case should ideally not happen if offer_openrouter_oauth succeeded + # but check defensively. + io.tool_error( + "OpenRouter authentication seemed successful, but the key is still missing." + ) + analytics.event( + "exit", + reason="OpenRouter key missing after successful OAuth for specified model", + ) + return 1 else: # OAuth failed or was declined by the user - io.tool_error(f"Unable to proceed without an OpenRouter API key for model '{args.model}'.") + io.tool_error( + f"Unable to proceed without an OpenRouter API key for model '{args.model}'." + ) io.offer_url(urls.models_and_keys, "Open documentation URL for more info?") - analytics.event("exit", reason="OpenRouter key missing for specified model and OAuth failed/declined") + analytics.event( + "exit", + reason="OpenRouter key missing for specified model and OAuth failed/declined", + ) return 1 main_model = models.Model( @@ -1241,4 +1256,3 @@ def load_slow_imports(swallow=True): if __name__ == "__main__": status = main() sys.exit(status) -