diff --git a/community/test/api/upload/command.py b/community/test/api/upload/command.py index 622a34d..b5aa69d 100755 --- a/community/test/api/upload/command.py +++ b/community/test/api/upload/command.py @@ -8,7 +8,7 @@ import requests ROOT_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.append(ROOT_DIR) -from api.utils import ( +from api.utils import ( # noqa: E402 OPENAPI_URL, PROJECT_ID, SERVER_URL, diff --git a/merico/chatflow/util/contexts.py b/merico/chatflow/util/contexts.py index 76c947c..2dcf435 100644 --- a/merico/chatflow/util/contexts.py +++ b/merico/chatflow/util/contexts.py @@ -57,7 +57,7 @@ def load_existing_workflow_defines() -> str: with open(os.path.join(root, "command.yml"), "r") as f: wrkflow_defines.append( ( - f"工作流命令/{root[len(root_path)+1:].replace(os.sep, '.')}的定义:" + f"工作流命令/{root[len(root_path) + 1 :].replace(os.sep, '.')}的定义:" f"\n{f.read()}\n\n" ) ) diff --git a/merico/refactor/rewrite.py b/merico/refactor/rewrite.py index 8e9ee20..670f123 100644 --- a/merico/refactor/rewrite.py +++ b/merico/refactor/rewrite.py @@ -310,7 +310,7 @@ def format_symbol_results(symbols: List[Dict[str, Any]], definitions: Dict[str, result += f"找到 {len(symbols)} 个可能缺少定义的符号:\n\n" for i, symbol in enumerate(symbols): - result += f"### {i+1}. {symbol['name']} ({symbol['type']})\n\n" + result += f"### {i + 1}. {symbol['name']} ({symbol['type']})\n\n" result += f"- 位置: 第{symbol['line'] + 1}行,第{symbol['character'] + 1}列\n" result += f"- 原因: {symbol['reason']}\n\n" @@ -340,7 +340,7 @@ def format_usage_suggestions(suggestions: List[Dict[str, Any]]) -> str: result = "## 符号使用建议\n\n" for i, suggestion in enumerate(suggestions): - result += f"### {i+1}. {suggestion['symbol']}\n\n" + result += f"### {i + 1}. {suggestion['symbol']}\n\n" result += f"**正确使用方法**:\n{suggestion['explanation']}\n\n" if suggestion.get("errors"): diff --git a/merico/unit_tests/ut_workflow.py b/merico/unit_tests/ut_workflow.py index b670413..052ecbe 100644 --- a/merico/unit_tests/ut_workflow.py +++ b/merico/unit_tests/ut_workflow.py @@ -293,7 +293,10 @@ class UnitTestsWorkflow: width = len(str(len(contexts))) lines.extend( [ - f"{(i + 1):>{width}}. {c.file_path}:{c.range.start.line + 1}-{c.range.end.line + 1}" + ( + f"{(i + 1):>{width}}. {c.file_path}:" + f"{c.range.start.line + 1}-{c.range.end.line + 1}" + ) for i, c in enumerate(contexts) ] )