Skip to content

Commit d1dabab

Browse files
pre-commit-ci[bot]ahal
authored andcommitted
style: pre-commit.ci auto fixes [...]
1 parent eb3f3c6 commit d1dabab

File tree

8 files changed

+11
-33
lines changed

8 files changed

+11
-33
lines changed

src/taskgraph/actions/retrigger.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,7 @@ def rerun_action(parameters, graph_config, input, task_group_id, task_id):
206206
label = task["metadata"]["name"]
207207
if task_id not in label_to_taskid.values():
208208
logger.error(
209-
"Refusing to rerun {}: taskId {} not in decision task {} label_to_taskid!".format(
210-
label, task_id, decision_task_id
211-
)
209+
f"Refusing to rerun {label}: taskId {task_id} not in decision task {decision_task_id} label_to_taskid!"
212210
)
213211

214212
_rerun_task(task_id, label)

src/taskgraph/optimize/strategies.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ def should_remove_task(self, task, params, file_patterns):
5656
changed = files_changed.check(params, file_patterns)
5757
if not changed:
5858
logger.debug(
59-
'no files found matching a pattern in `skip-unless-changed` for "{}"'.format(
60-
task.label
61-
)
59+
f'no files found matching a pattern in `skip-unless-changed` for "{task.label}"'
6260
)
6361
return True
6462
return False

src/taskgraph/transforms/run/__init__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -403,11 +403,7 @@ def wrap(func):
403403
for_run_using = registry.setdefault(run_using, {})
404404
if worker_implementation in for_run_using:
405405
raise Exception(
406-
"run_task_using({!r}, {!r}) already exists: {!r}".format(
407-
run_using,
408-
worker_implementation,
409-
for_run_using[worker_implementation],
410-
)
406+
f"run_task_using({run_using!r}, {worker_implementation!r}) already exists: {for_run_using[worker_implementation]!r}"
411407
)
412408
for_run_using[worker_implementation] = (func, schema, defaults)
413409
return func

src/taskgraph/transforms/task.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,9 +1153,9 @@ def build_task(config, tasks):
11531153
config.params["project"] + th_project_suffix, branch_rev
11541154
)
11551155
)
1156-
task_def["metadata"]["description"] += " ([Treeherder push]({}))".format(
1157-
th_push_link
1158-
)
1156+
task_def["metadata"][
1157+
"description"
1158+
] += f" ([Treeherder push]({th_push_link}))"
11591159

11601160
# add the payload and adjust anything else as required (e.g., scopes)
11611161
payload_builders[task["worker"]["implementation"]].builder(

src/taskgraph/util/hash.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,7 @@ def hash_paths(base_path, patterns):
3939
raise Exception("%s did not match anything" % pattern)
4040
for path in sorted(found):
4141
h.update(
42-
"{} {}\n".format(
43-
hash_path(mozpath.abspath(mozpath.join(base_path, path))),
44-
mozpath.normsep(path),
45-
).encode("utf-8")
42+
f"{hash_path(mozpath.abspath(mozpath.join(base_path, path)))} {mozpath.normsep(path)}\n".encode()
4643
)
4744
return h.hexdigest()
4845

src/taskgraph/util/keyed_by.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,5 @@ def evaluate_keyed_by(
9191
continue
9292

9393
raise Exception(
94-
"No {} matching {!r} nor 'default' found while determining item {}".format(
95-
keyed_by, key, item_name
96-
)
94+
f"No {keyed_by} matching {key!r} nor 'default' found while determining item {item_name}"
9795
)

src/taskgraph/util/parameterization.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ def repl(match):
8585

8686
assert artifact_name.startswith(
8787
"public/"
88-
), "artifact-reference only supports public artifacts, not `{}`".format(
89-
artifact_name
90-
)
88+
), f"artifact-reference only supports public artifacts, not `{artifact_name}`"
9189
return get_artifact_url(task_id, artifact_name)
9290

9391
return ARTIFACT_REFERENCE_PATTERN.sub(repl, val)

src/taskgraph/util/verify.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,7 @@ def verify_trust_domain_v2_routes(
173173
if route.startswith(route_prefix):
174174
if route in scratch_pad:
175175
raise Exception(
176-
"conflict between {}:{} for route: {}".format(
177-
task.label, scratch_pad[route], route
178-
)
176+
f"conflict between {task.label}:{scratch_pad[route]} for route: {route}"
179177
)
180178
else:
181179
scratch_pad[route] = task.label
@@ -231,12 +229,7 @@ def printable_tier(tier):
231229
continue
232230
if tier < tiers[d]:
233231
raise Exception(
234-
"{} (tier {}) cannot depend on {} (tier {})".format(
235-
task.label,
236-
printable_tier(tier),
237-
d,
238-
printable_tier(tiers[d]),
239-
)
232+
f"{task.label} (tier {printable_tier(tier)}) cannot depend on {d} (tier {printable_tier(tiers[d])})"
240233
)
241234

242235

0 commit comments

Comments
 (0)