Skip to content

Commit bb7e691

Browse files
style: pre-commit.ci auto fixes [...]
1 parent 8022d63 commit bb7e691

File tree

12 files changed

+32
-33
lines changed

12 files changed

+32
-33
lines changed

src/taskgraph/actions/registry.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,18 +145,18 @@ def register_callback_action(
145145
def register_callback(cb):
146146
assert isinstance(name, str), "name must be a string"
147147
assert isinstance(order, int), "order must be an integer"
148-
assert callable(schema) or is_json(
149-
schema
150-
), "schema must be a JSON compatible object"
148+
assert callable(schema) or is_json(schema), (
149+
"schema must be a JSON compatible object"
150+
)
151151
assert isinstance(cb, FunctionType), "callback must be a function"
152152
# Allow for json-e > 25 chars in the symbol.
153153
if "$" not in symbol:
154154
assert 1 <= len(symbol) <= 25, "symbol must be between 1 and 25 characters"
155155
assert isinstance(symbol, str), "symbol must be a string"
156156

157-
assert not mem[
158-
"registered"
159-
], "register_callback_action must be used as decorator"
157+
assert not mem["registered"], (
158+
"register_callback_action must be used as decorator"
159+
)
160160
assert cb_name not in callbacks, f"callback name {cb_name} is not unique"
161161

162162
def action_builder(parameters, graph_config, decision_task_id):

src/taskgraph/config.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ def register(self):
142142
def vcs_root(self):
143143
if path.split(self.root_dir)[-1:] != ["taskcluster"]:
144144
raise Exception(
145-
"Not guessing path to vcs root. "
146-
"Graph config in non-standard location."
145+
"Not guessing path to vcs root. Graph config in non-standard location."
147146
)
148147
return os.path.dirname(self.root_dir)
149148

src/taskgraph/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ def logfile(spec):
326326
"--tasks-regex",
327327
"--tasks",
328328
default=None,
329-
help="only return tasks with labels matching this regular " "expression.",
329+
help="only return tasks with labels matching this regular expression.",
330330
)
331331
@argument(
332332
"--exclude-key",
@@ -757,7 +757,7 @@ def action_callback(options):
757757
"--parameters",
758758
"-p",
759759
default="",
760-
help="parameters file (.yml or .json; see " "`taskcluster/docs/parameters.rst`)`",
760+
help="parameters file (.yml or .json; see `taskcluster/docs/parameters.rst`)`",
761761
)
762762
@argument("--task-id", default=None, help="TaskId to which the action applies")
763763
@argument(

src/taskgraph/parameters.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,7 @@ def file_url(self, path, pretty=False):
286286
)
287287
else:
288288
raise ParameterMismatch(
289-
"Don't know how to determine file URL for non-github"
290-
f"repo: {repo}"
289+
f"Don't know how to determine file URL for non-githubrepo: {repo}"
291290
)
292291
else:
293292
raise RuntimeError(

src/taskgraph/transforms/fetch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def create_fetch_url_task(config, name, fetch):
235235
]
236236

237237
if fetch.get("strip-components"):
238-
args.extend(["--strip-components", f'{fetch["strip-components"]}'])
238+
args.extend(["--strip-components", f"{fetch['strip-components']}"])
239239

240240
if fetch.get("add-prefix"):
241241
args.extend(["--add-prefix", fetch["add-prefix"]])

src/taskgraph/transforms/task.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def _run_task_suffix():
204204

205205

206206
UNKNOWN_GROUP_NAME = (
207-
"Treeherder group {} (from {}) has no name; " "add it to taskcluster/config.yml"
207+
"Treeherder group {} (from {}) has no name; add it to taskcluster/config.yml"
208208
)
209209

210210
V2_ROUTE_TEMPLATES = [
@@ -372,9 +372,9 @@ def build_docker_worker_payload(config, task, task_def):
372372
if "in-tree" in image:
373373
name = image["in-tree"]
374374
docker_image_task = "docker-image-" + image["in-tree"]
375-
assert "docker-image" not in task.get(
376-
"dependencies", ()
377-
), "docker-image key in dependencies object is reserved"
375+
assert "docker-image" not in task.get("dependencies", ()), (
376+
"docker-image key in dependencies object is reserved"
377+
)
378378
task.setdefault("dependencies", {})["docker-image"] = docker_image_task
379379

380380
image = {

src/taskgraph/util/dependencies.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515
def group_by(name, schema=None):
1616
def wrapper(func):
17-
assert (
18-
name not in GROUP_BY_MAP
19-
), f"duplicate group_by function name {name} ({func} and {GROUP_BY_MAP[name]})"
17+
assert name not in GROUP_BY_MAP, (
18+
f"duplicate group_by function name {name} ({func} and {GROUP_BY_MAP[name]})"
19+
)
2020
GROUP_BY_MAP[name] = func
2121
func.schema = schema
2222
return func

src/taskgraph/util/docker.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,7 @@ def parse_volumes(image):
239239
v = line.split(None, 1)[1]
240240
if v.startswith(b"["):
241241
raise ValueError(
242-
"cannot parse array syntax for VOLUME; "
243-
"convert to multiple entries"
242+
"cannot parse array syntax for VOLUME; convert to multiple entries"
244243
)
245244

246245
volumes |= {volume.decode("utf-8") for volume in v.split()}

src/taskgraph/util/set_name.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
def set_name(name, schema=None):
1313
def wrapper(func):
14-
assert (
15-
name not in SET_NAME_MAP
16-
), f"duplicate set_name function name {name} ({func} and {SET_NAME_MAP[name]})"
14+
assert name not in SET_NAME_MAP, (
15+
f"duplicate set_name function name {name} ({func} and {SET_NAME_MAP[name]})"
16+
)
1717
SET_NAME_MAP[name] = func
1818
func.schema = schema
1919
return func

test/test_generator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,9 @@ def test_load_tasks_for_kind(monkeypatch):
199199
)
200200
def test_default_loader(config, expected_transforms):
201201
loader = Kind("", "", config, {})._get_loader()
202-
assert (
203-
loader is default_loader
204-
), "Default Kind loader should be taskgraph.loader.default.loader"
202+
assert loader is default_loader, (
203+
"Default Kind loader should be taskgraph.loader.default.loader"
204+
)
205205
loader("", "", config, {}, [])
206206

207207
assert config["transforms"] == expected_transforms

0 commit comments

Comments
 (0)