[cleanup] Migrate more string formatting to f-strings
Bug: 121197
Change-Id: I1d26a2a4a98574a13dbad00f04cec74fdc6f2988
Reviewed-on: https://fuchsia-review.googlesource.com/c/infra/recipes/+/797907
Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com>
Fuchsia-Auto-Submit: Anthony Fandrianto <atyfto@google.com>
Reviewed-by: Oliver Newman <olivernewman@google.com>
diff --git a/recipe_modules/build/api.py b/recipe_modules/build/api.py
index c1a2ed2..1749b1a 100644
--- a/recipe_modules/build/api.py
+++ b/recipe_modules/build/api.py
@@ -366,14 +366,14 @@
presentation.status = self._api.step.FAILURE
raise self._api.step.StepFailure(
- "One or more binary size creep budgets were exceeded. See "
- "the binary size table in Gerrit for more details.\n\n If "
- "this change cannot be reworked to fit under the creep "
- "budgets, request a %s+1 by adding "
- "fuchsia-size-reviews@google.com as a reviewer on your CL, "
- "and a size reviewer will be automatically assigned. Once "
- "you have %s+1, retry the build / CQ attempt."
- % (size_creep_label, size_creep_label)
+ f"One or more binary size creep budgets were exceeded. "
+ f"See the binary size table in Gerrit for more details."
+ f"\n\n If this change cannot be reworked to fit under "
+ f"the creep budgets, request a {size_creep_label}+1 by "
+ f"adding fuchsia-size-reviews@google.com as a reviewer "
+ f"on your CL, and a size reviewer will be "
+ f"automatically assigned. Once you have "
+ f"{size_creep_label}+1, retry the build / CQ attempt."
)
finally:
prepared_step.upload()
diff --git a/recipe_modules/jiri/api.py b/recipe_modules/jiri/api.py
index b1dd944..927300e 100644
--- a/recipe_modules/jiri/api.py
+++ b/recipe_modules/jiri/api.py
@@ -392,7 +392,7 @@
cmd.extend(["-import", i])
test_imports.append((i, "HEAD"))
elif isinstance(i, tuple):
- cmd.extend(["-import", "%s=%s" % i])
+ cmd.extend(["-import", f"{i[0]}={i[1]}"])
test_imports.append(i)
# Test data consisting of (name, revision) tuples of projects to edit in the
@@ -405,7 +405,7 @@
cmd.extend(["-project", p])
test_projects.append((p, "HEAD"))
elif isinstance(p, tuple):
- cmd.extend(["-project", "%s=%s" % p])
+ cmd.extend(["-project", f"{p[0]}={p[1]}"])
test_projects.append(p)
# Test data consisting of (name, version) tuples of packages to edit in the
@@ -414,7 +414,7 @@
if packages:
for p in packages:
- cmd.extend(["-package", "%s=%s" % p])
+ cmd.extend(["-package", f"{p[0]}={p[1]}"])
test_packages.append(p)
cmd.extend([manifest])
diff --git a/recipes/contrib/kythe.py b/recipes/contrib/kythe.py
index bdc76b6..31b6b20 100644
--- a/recipes/contrib/kythe.py
+++ b/recipes/contrib/kythe.py
@@ -44,10 +44,9 @@
with api.context(cwd=checkout.root_dir):
revision = checkout.project("fuchsia")["revision"]
commit_timestamp = int(api.time.time())
- kzip_name_with_revision = "fuchsia_%s_%s+%d.kzip" % (
- build_results.set_metadata.target_arch,
- revision,
- commit_timestamp,
+ kzip_name_with_revision = (
+ f"fuchsia_{build_results.set_metadata.target_arch}_{revision}+"
+ f"{commit_timestamp}.kzip"
)
if api.buildbucket_util.is_tryjob: