From 8f5b243c1b2073b1e53aaa99c1e022a6d3e384bc Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Fri, 30 Aug 2024 18:28:45 -0700 Subject: [PATCH] refactor: improve platform info and shell command suggestions --- aider/coders/base_coder.py | 6 +++--- aider/coders/editblock_prompts.py | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index c542cd67a..9c9f81248 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -885,15 +885,15 @@ class Coder: platform_text += "- The user is operating inside a git repository\n" if self.lint_cmds: - platform_text += "- Lint commands:\n" + platform_text += "- The user's pre-commit runs these lint commands:\n" for lang, cmd in self.lint_cmds.items(): if lang is None: - platform_text += f" - Default: {cmd}\n" + platform_text += f" - {cmd}\n" else: platform_text += f" - {lang}: {cmd}\n" if self.test_cmd: - platform_text += f"- Test command: {self.test_cmd}\n" + platform_text += f"- The user's pre-commit runs this test command: {self.test_cmd}\n" return platform_text diff --git a/aider/coders/editblock_prompts.py b/aider/coders/editblock_prompts.py index 39200c7e8..372bc9fff 100644 --- a/aider/coders/editblock_prompts.py +++ b/aider/coders/editblock_prompts.py @@ -35,6 +35,7 @@ Only suggest complete shell commands that area ready to execute, without placeho Use the appropriate shell based on the user's system info: {platform} +Don't offer to run the lint and test commands that are already part of the user's pre-commit. Examples of when to suggest shell commands: