fix lint errors
This commit is contained in:
parent
cceb4c1dfb
commit
946d9dcf25
@ -8,7 +8,7 @@ import requests
|
|||||||
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
ROOT_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
sys.path.append(ROOT_DIR)
|
sys.path.append(ROOT_DIR)
|
||||||
|
|
||||||
from api.utils import (
|
from api.utils import ( # noqa: E402
|
||||||
OPENAPI_URL,
|
OPENAPI_URL,
|
||||||
PROJECT_ID,
|
PROJECT_ID,
|
||||||
SERVER_URL,
|
SERVER_URL,
|
||||||
|
@ -57,7 +57,7 @@ def load_existing_workflow_defines() -> str:
|
|||||||
with open(os.path.join(root, "command.yml"), "r") as f:
|
with open(os.path.join(root, "command.yml"), "r") as f:
|
||||||
wrkflow_defines.append(
|
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"
|
f"\n{f.read()}\n\n"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -310,7 +310,7 @@ def format_symbol_results(symbols: List[Dict[str, Any]], definitions: Dict[str,
|
|||||||
result += f"找到 {len(symbols)} 个可能缺少定义的符号:\n\n"
|
result += f"找到 {len(symbols)} 个可能缺少定义的符号:\n\n"
|
||||||
|
|
||||||
for i, symbol in enumerate(symbols):
|
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['line'] + 1}行,第{symbol['character'] + 1}列\n"
|
||||||
result += f"- 原因: {symbol['reason']}\n\n"
|
result += f"- 原因: {symbol['reason']}\n\n"
|
||||||
|
|
||||||
@ -340,7 +340,7 @@ def format_usage_suggestions(suggestions: List[Dict[str, Any]]) -> str:
|
|||||||
result = "## 符号使用建议\n\n"
|
result = "## 符号使用建议\n\n"
|
||||||
|
|
||||||
for i, suggestion in enumerate(suggestions):
|
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"
|
result += f"**正确使用方法**:\n{suggestion['explanation']}\n\n"
|
||||||
|
|
||||||
if suggestion.get("errors"):
|
if suggestion.get("errors"):
|
||||||
|
@ -293,7 +293,10 @@ class UnitTestsWorkflow:
|
|||||||
width = len(str(len(contexts)))
|
width = len(str(len(contexts)))
|
||||||
lines.extend(
|
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)
|
for i, c in enumerate(contexts)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user