[PATCH] D135532: [github] Fix minor lint warnings (NFC)
Keith Smiley via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 14 15:47:13 PDT 2022
This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc116bd9f607a: [github] Fix minor lint warnings (NFC) (authored by keith).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D135532/new/
https://reviews.llvm.org/D135532
Files:
llvm/utils/git/github-automation.py
llvm/utils/git/pre-push.py
Index: llvm/utils/git/pre-push.py
===================================================================
--- llvm/utils/git/pre-push.py
+++ llvm/utils/git/pre-push.py
@@ -27,14 +27,11 @@
"""
import argparse
-import collections
import os
-import re
import shutil
import subprocess
import sys
import time
-import getpass
from shlex import quote
VERBOSE = False
Index: llvm/utils/git/github-automation.py
===================================================================
--- llvm/utils/git/github-automation.py
+++ llvm/utils/git/github-automation.py
@@ -16,7 +16,7 @@
import requests
import sys
import time
-from typing import *
+from typing import List, Optional
class IssueSubscriber:
@@ -60,7 +60,7 @@
return response.json()
-def phab_login_to_github_login(phab_token:str, repo:github.Repository.Repository, phab_login:str) -> str:
+def phab_login_to_github_login(phab_token:str, repo:github.Repository.Repository, phab_login:str) -> Optional[str]:
"""
Tries to translate a Phabricator login to a github login by
finding a commit made in Phabricator's Differential.
@@ -94,7 +94,7 @@
return None
return committer.login
-def phab_get_commit_approvers(phab_token:str, repo:github.Repository.Repository, commit:github.Commit.Commit) -> list:
+def phab_get_commit_approvers(phab_token:str, commit:github.Commit.Commit) -> list:
args = { "corpus" : commit.commit.message }
# API documentation: https://reviews.llvm.org/conduit/method/differential.parsecommitmessage/
r = phab_api_call(phab_token, "https://reviews.llvm.org/api/differential.parsecommitmessage", args)
@@ -263,7 +263,7 @@
"""
reviewers = []
for commit in pr.get_commits():
- approvers = phab_get_commit_approvers(self.phab_token, self.repo, commit)
+ approvers = phab_get_commit_approvers(self.phab_token, commit)
for a in approvers:
login = phab_login_to_github_login(self.phab_token, self.repo, a)
if not login:
@@ -334,7 +334,7 @@
head_branch = f'{owner}-{branch}'
local_repo = Repo(self.llvm_project_dir)
push_done = False
- for i in range(0,5):
+ for _ in range(0,5):
try:
local_repo.git.fetch(f'https://github.com/{owner}/{repo_name}', f'{branch}:{branch}')
local_repo.git.push(self.push_url, f'{branch}:{head_branch}', force=True)
@@ -388,7 +388,7 @@
"""
for line in sys.stdin:
line.rstrip()
- m = re.search("/([a-z-]+)\s(.+)", line)
+ m = re.search(r"/([a-z-]+)\s(.+)", line)
if not m:
continue
command = m.group(1)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135532.467951.patch
Type: text/x-patch
Size: 2772 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221014/c07098fc/attachment.bin>
More information about the llvm-commits
mailing list