mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-20 12:24:59 +00:00
refactor: Move comment_body to a global multiline string
This commit is contained in:
parent
26f9a10324
commit
0101ae76d1
1 changed files with 5 additions and 6 deletions
|
@ -12,6 +12,10 @@ from tqdm import tqdm
|
|||
# Load environment variables from .env file
|
||||
load_dotenv()
|
||||
|
||||
DUPLICATE_COMMENT = """Thanks for trying aider and filing this issue.
|
||||
|
||||
This looks like a duplicate of #{oldest_issue_number}, so I'm going to close it so discussion can happen there. Please let me know if you think it's actually a distinct issue."""
|
||||
|
||||
# GitHub API configuration
|
||||
GITHUB_API_URL = "https://api.github.com"
|
||||
REPO_OWNER = "paul-gauthier"
|
||||
|
@ -83,12 +87,7 @@ def comment_and_close_duplicate(issue, oldest_issue):
|
|||
)
|
||||
close_url = f"{GITHUB_API_URL}/repos/{REPO_OWNER}/{REPO_NAME}/issues/{issue['number']}"
|
||||
|
||||
comment_body = (
|
||||
"Thanks for trying aider and filing this issue.\n\n"
|
||||
f"This looks like a duplicate of #{oldest_issue['number']}, so I'm going to close it so"
|
||||
" discussion can happen there. Please let me know if you think it's actually a distinct"
|
||||
" issue."
|
||||
)
|
||||
comment_body = DUPLICATE_COMMENT.format(oldest_issue_number=oldest_issue['number'])
|
||||
|
||||
# Post comment
|
||||
response = requests.post(comment_url, headers=headers, json={"body": comment_body})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue