mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 00:05:01 +00:00
style: Format issues.py with black linter
This commit is contained in:
parent
46251c6a1c
commit
ddfd1276c5
1 changed files with 16 additions and 11 deletions
|
@ -115,25 +115,30 @@ def comment_and_close_duplicate(issue, oldest_issue):
|
||||||
def find_unlabeled_with_paul_comments(issues):
|
def find_unlabeled_with_paul_comments(issues):
|
||||||
unlabeled_issues = []
|
unlabeled_issues = []
|
||||||
for issue in issues:
|
for issue in issues:
|
||||||
if not issue['labels'] and issue['state'] == 'open':
|
if not issue["labels"] and issue["state"] == "open":
|
||||||
# Get comments for this issue
|
# Get comments for this issue
|
||||||
comments_url = f"{GITHUB_API_URL}/repos/{REPO_OWNER}/{REPO_NAME}/issues/{issue['number']}/comments"
|
comments_url = (
|
||||||
|
f"{GITHUB_API_URL}/repos/{REPO_OWNER}/{REPO_NAME}/issues/{issue['number']}/comments"
|
||||||
|
)
|
||||||
response = requests.get(comments_url, headers=headers)
|
response = requests.get(comments_url, headers=headers)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
comments = response.json()
|
comments = response.json()
|
||||||
|
|
||||||
# Check if paul-gauthier has commented
|
# Check if paul-gauthier has commented
|
||||||
if any(comment['user']['login'] == 'paul-gauthier' for comment in comments):
|
if any(comment["user"]["login"] == "paul-gauthier" for comment in comments):
|
||||||
unlabeled_issues.append(issue)
|
unlabeled_issues.append(issue)
|
||||||
return unlabeled_issues
|
return unlabeled_issues
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
parser = argparse.ArgumentParser(description="Handle duplicate GitHub issues")
|
parser = argparse.ArgumentParser(description="Handle duplicate GitHub issues")
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--yes", action="store_true", help="Automatically close duplicates without prompting"
|
"--yes", action="store_true", help="Automatically close duplicates without prompting"
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--find-unlabeled", action="store_true", help="Find unlabeled issues with paul-gauthier comments"
|
"--find-unlabeled",
|
||||||
|
action="store_true",
|
||||||
|
help="Find unlabeled issues with paul-gauthier comments",
|
||||||
)
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
@ -142,25 +147,25 @@ def main():
|
||||||
return
|
return
|
||||||
|
|
||||||
all_issues = get_issues("all")
|
all_issues = get_issues("all")
|
||||||
|
|
||||||
if args.find_unlabeled:
|
if args.find_unlabeled:
|
||||||
print("\nFinding unlabeled issues with paul-gauthier comments...")
|
print("\nFinding unlabeled issues with paul-gauthier comments...")
|
||||||
unlabeled_issues = find_unlabeled_with_paul_comments(all_issues)
|
unlabeled_issues = find_unlabeled_with_paul_comments(all_issues)
|
||||||
|
|
||||||
if not unlabeled_issues:
|
if not unlabeled_issues:
|
||||||
print("No unlabeled issues with paul-gauthier comments found.")
|
print("No unlabeled issues with paul-gauthier comments found.")
|
||||||
return
|
return
|
||||||
|
|
||||||
print(f"\nFound {len(unlabeled_issues)} unlabeled issues with paul-gauthier comments:")
|
print(f"\nFound {len(unlabeled_issues)} unlabeled issues with paul-gauthier comments:")
|
||||||
for issue in unlabeled_issues:
|
for issue in unlabeled_issues:
|
||||||
print(f" - #{issue['number']}: {issue['title']} {issue['html_url']}")
|
print(f" - #{issue['number']}: {issue['title']} {issue['html_url']}")
|
||||||
|
|
||||||
if not args.yes:
|
if not args.yes:
|
||||||
confirm = input("\nDo you want to add the 'question' label to these issues? (y/n): ")
|
confirm = input("\nDo you want to add the 'question' label to these issues? (y/n): ")
|
||||||
if confirm.lower() != 'y':
|
if confirm.lower() != "y":
|
||||||
print("Skipping labeling.")
|
print("Skipping labeling.")
|
||||||
return
|
return
|
||||||
|
|
||||||
print("\nAdding 'question' label to issues...")
|
print("\nAdding 'question' label to issues...")
|
||||||
for issue in unlabeled_issues:
|
for issue in unlabeled_issues:
|
||||||
url = f"{GITHUB_API_URL}/repos/{REPO_OWNER}/{REPO_NAME}/issues/{issue['number']}"
|
url = f"{GITHUB_API_URL}/repos/{REPO_OWNER}/{REPO_NAME}/issues/{issue['number']}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue