From 56e4bab9ec0db06b224b0cc692160bb60733e8b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E4=BC=9F=E9=9F=AC?= Date: Thu, 12 Sep 2024 09:56:38 +0800 Subject: [PATCH] fix issues --- metagpt/tools/libs/editor.py | 3 +-- metagpt/tools/libs/linter.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/metagpt/tools/libs/editor.py b/metagpt/tools/libs/editor.py index f8bf7135e..63d7f9fd9 100644 --- a/metagpt/tools/libs/editor.py +++ b/metagpt/tools/libs/editor.py @@ -730,8 +730,7 @@ class Editor(BaseModel): if to_replace.strip() == "": if file_content.strip() == "": raise ValueError(f"The file '{file_name}' is empty. Please use the append method to add content.") - else: - raise ValueError("`to_replace` must not be empty.") + raise ValueError("`to_replace` must not be empty.") if file_content.count(to_replace) > 1: raise ValueError( diff --git a/metagpt/tools/libs/linter.py b/metagpt/tools/libs/linter.py index 4e1a2defe..7720d6962 100644 --- a/metagpt/tools/libs/linter.py +++ b/metagpt/tools/libs/linter.py @@ -32,7 +32,7 @@ class Linter: self.languages = dict( python=self.py_lint, - sql=self.fake_lint, # Base_lint lacks support for full SQL syntax. Use fake_lint to bypass the validation. + sql=self.fake_lint, # base_lint lacks support for full SQL syntax. Use fake_lint to bypass the validation. ) self.all_lint_cmd = None