Skip to content

Commit 7027331

Browse files
committed
run pre-commit formatting
1 parent 09adb24 commit 7027331

File tree

2 files changed

+27
-23
lines changed

2 files changed

+27
-23
lines changed

tools/ci_changes_per_commit.py

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -143,27 +143,29 @@ def set_output(name, value):
143143

144144
def get_commit_depth_and_check_suite(query_commits):
145145
while True:
146-
commits = query_commits.fetch()["data"]["repository"]["pullRequest"]["commits"]
147-
148-
if commits["totalCount"] > 0:
149-
nodes = commits["nodes"]
150-
nodes.reverse()
151-
if nodes[0]["commit"]["oid"] == os.environ["EXCLUDE_COMMIT"]:
152-
nodes.pop(0)
153-
for index, commit in enumerate(nodes):
154-
commit = commit["commit"]
155-
commit_sha = commit["oid"]
156-
check_suites = commit["checkSuites"]
157-
if check_suites["totalCount"] > 0:
158-
for check_suite in check_suites["nodes"]:
159-
if check_suite["workflowRun"]["workflow"]["name"] == "Build CI":
160-
return [
161-
{"sha": commit_sha, "depth": index + 1},
162-
check_suite["id"] if check_suite["conclusion"] != "SUCCESS" else None,
163-
]
164-
else:
165-
if not query_commits.paginate(commits["pageInfo"], "beforeCommit"):
166-
break
146+
commits = query_commits.fetch()["data"]["repository"]["pullRequest"]["commits"]
147+
148+
if commits["totalCount"] > 0:
149+
nodes = commits["nodes"]
150+
nodes.reverse()
151+
if nodes[0]["commit"]["oid"] == os.environ["EXCLUDE_COMMIT"]:
152+
nodes.pop(0)
153+
for index, commit in enumerate(nodes):
154+
commit = commit["commit"]
155+
commit_sha = commit["oid"]
156+
check_suites = commit["checkSuites"]
157+
if check_suites["totalCount"] > 0:
158+
for check_suite in check_suites["nodes"]:
159+
if check_suite["workflowRun"]["workflow"]["name"] == "Build CI":
160+
return [
161+
{"sha": commit_sha, "depth": index + 1},
162+
check_suite["id"]
163+
if check_suite["conclusion"] != "SUCCESS"
164+
else None,
165+
]
166+
else:
167+
if not query_commits.paginate(commits["pageInfo"], "beforeCommit"):
168+
break
167169

168170
return [None, None]
169171

@@ -197,7 +199,9 @@ def get_bad_check_runs(query_check_runs):
197199

198200
append_runs_to_list(check_runs[run_type], bad_runs_by_matrix)
199201

200-
if query_check_runs.paginate(check_runs[run_type]["pageInfo"], "after" + run_type_camel):
202+
if query_check_runs.paginate(
203+
check_runs[run_type]["pageInfo"], "after" + run_type_camel
204+
):
201205
query_check_runs.variables["include" + run_type_camel] = True
202206
more_pages = True
203207

tools/ci_fetch_deps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def run(title, command, check=True):
7171
f'git fetch --recurse-submodules=no --shallow-since="2021-07-01" origin {ref}',
7272
)
7373
# See https://stackoverflow.com/questions/63878612/git-fatal-error-in-object-unshallow-sha-1#comment118418373_63879454
74-
run ("Fix for bug \"fatal: error in object: unshallow\"", "git repack -d")
74+
run('Fix for bug "fatal: error in object: unshallow"', "git repack -d")
7575
run("Init submodules", "git submodule init")
7676
run("Submodule status", "git submodule status")
7777

0 commit comments

Comments
 (0)