fix lint errors

This commit is contained in:
bobo.yang 2025-03-11 14:19:20 +08:00
parent 7353fe1df4
commit cceb4c1dfb
6 changed files with 10 additions and 13 deletions

View File

@ -293,7 +293,7 @@ def generate_commit_message_base_diff(user_input, diff, issue):
if (
not response["content"]
and response.get("error", None)
and f'{response["error"]}'.find("This model's maximum context length is") > 0
and f"{response['error']}".find("This model's maximum context length is") > 0
):
print(model_token_limit_error)
sys.exit(0)

View File

@ -286,7 +286,7 @@ def generate_commit_message_base_diff(user_input, diff, issue):
if (
not response["content"]
and response.get("error", None)
and f'{response["error"]}'.find("This model's maximum context length is") > 0
and f"{response['error']}".find("This model's maximum context length is") > 0
):
print(model_token_limit_error)
sys.exit(0)

View File

@ -2,8 +2,6 @@ import json
import os
import sys
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))
from lib.chatmark import Form, TextEditor # 导入 ChatMark 组件

View File

@ -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 ( # noqa: E402
from api.utils import (
OPENAPI_URL,
PROJECT_ID,
SERVER_URL,

View File

@ -22,9 +22,9 @@ class Form:
components: components in the form, can be widgets (except Button) or strings
title: title of the form
"""
assert (
any(isinstance(c, Button) for c in components) is False
), "Button is not allowed in Form"
assert any(isinstance(c, Button) for c in components) is False, (
"Button is not allowed in Form"
)
self._components = components
self._title = title

View File

@ -189,8 +189,7 @@ class UnitTestsWorkflow:
case_editor = TextEditor(
text="",
title=_i(
"You can add more test cases here\n"
"(Multiple cases can be separated by line breaks)"
"You can add more test cases here\n(Multiple cases can be separated by line breaks)"
),
)
ref_editor = TextEditor(