Skip to content

Commit 9792eda

Browse files
committed
Format bin/combine-buildkite
1 parent 53ee62f commit 9792eda

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

bin/combine-buildkite

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ import requests
88

99
_API_TOKEN = os.environ["BUILDKITE_API_TOKEN"]
1010
_BASE_URL = "https://api.buildkite.com/v2/organizations/"
11-
_BUILDKITE_AUTH_HEADERS = {"Authorization": f"Bearer {_API_TOKEN}", "Content-Type": "application/json"}
11+
_BUILDKITE_AUTH_HEADERS = {
12+
"Authorization": f"Bearer {_API_TOKEN}",
13+
"Content-Type": "application/json",
14+
}
1215

1316
ansi_escape_8bit = re.compile(
1417
r"(?:\x1B[@-Z\\-_]|[\x80-\x9A\x9C-\x9F]|(?:\x1B\[|\x9B)[0-?]*[ -/]*[@-~])"
@@ -20,20 +23,14 @@ def _build_parser() -> argparse.ArgumentParser:
2023
parser.add_argument(
2124
"pipeline", help="Pipeline to combine logs for, ex: bazelbuild/bazel"
2225
)
23-
parser.add_argument(
24-
"build_number", help="Build number to combine logs for"
25-
)
26+
parser.add_argument("build_number", help="Build number to combine logs for")
2627
return parser
2728

2829

29-
def _get_job_log(
30-
job_url: str
31-
) -> str:
30+
def _get_job_log(job_url: str) -> str:
3231
response = requests.get(job_url, headers=_BUILDKITE_AUTH_HEADERS)
3332
response.raise_for_status()
34-
return ansi_escape_8bit.sub("", response.json()["content"]).replace(
35-
"\r", ""
36-
)
33+
return ansi_escape_8bit.sub("", response.json()["content"]).replace("\r", "")
3734

3835

3936
async def _main(org: str, pipeline: str, build_number: str) -> None:
@@ -65,4 +62,4 @@ if __name__ == "__main__":
6562
args = _build_parser().parse_args()
6663
org, pipeline = args.pipeline.split("/", 1)
6764
loop = asyncio.get_event_loop()
68-
loop.run_until_complete(_main(org, pipeline, args.build_number))
65+
loop.run_until_complete(_main(org, pipeline, args.build_number))

0 commit comments

Comments
 (0)