fix lint error

This commit is contained in:
bobo 2024-06-30 16:07:38 +08:00
parent da9f21e1dc
commit 8cbb645fa8
4 changed files with 15 additions and 5 deletions

View File

@ -412,8 +412,10 @@ def update_pr(pr_number, title, body, repo_name):
print("Failed to update PR.")
return None
def get_last_base_branch(default_branch):
""" read last base branch from config file """
"""read last base branch from config file"""
def read_config_item(config_path, item):
if os.path.exists(config_path):
with open(config_path, "r", encoding="utf-8") as f:
@ -427,8 +429,10 @@ def get_last_base_branch(default_branch):
return last_base_branch
return default_branch
def save_last_base_branch(base_branch=None):
""" save last base branch to config file """
"""save last base branch to config file"""
def save_config_item(config_path, item, value):
if os.path.exists(config_path):
with open(config_path, "r", encoding="utf-8") as f:

View File

@ -46,7 +46,9 @@ def get_issue_or_task(task):
issue = read_issue_by_url(task.strip())
assert_exit(not issue, "Failed to read issue.", exit_code=-1)
return json.dumps({"id": issue["number"], "title": issue["title"], "body": issue["body"]}), issue["number"]
return json.dumps(
{"id": issue["number"], "title": issue["title"], "body": issue["body"]}
), issue["number"]
else:
return task, None

View File

@ -57,10 +57,12 @@ def generate_pr_content(issue, commit_messages, user_input):
def edit_pr(title, body):
pass
@ui_edit(ui_type="editor", description="Edit base branch:")
def edit_base_branch(base_branch):
pass
def get_issue_json(issue_id):
issue = {"id": "no issue id", "title": "", "body": ""}
if issue_id:

View File

@ -15,10 +15,10 @@ from git_api import ( # noqa: E402
get_current_branch,
get_github_repo,
get_issue_info,
get_recently_pr,
update_pr,
get_last_base_branch,
get_recently_pr,
save_last_base_branch,
update_pr,
)
@ -57,10 +57,12 @@ def generate_pr_content(issue, commit_messages):
def edit_pr(title, body):
pass
@ui_edit(ui_type="editor", description="Edit base branch:")
def edit_base_branch(base_branch):
pass
def get_issue_json(issue_id):
issue = {"id": "no issue id", "title": "", "body": ""}
if issue_id: