Skip to content

Commit

Permalink
style: pre-commit.ci auto fixes [...]
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Jan 7, 2025
1 parent 929b6ea commit 4e22fba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/taskgraph/transforms/run/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ def should_use_cache(
return name not in exclude_caches


def support_caches(config: TransformConfig, task: dict[str, Any], taskdesc: dict[str, Any]):
def support_caches(
config: TransformConfig, task: dict[str, Any], taskdesc: dict[str, Any]
):
"""Add caches for common tools."""
run = task["run"]
base_cache_dir = f"{run['workdir']}/.cache"
Expand Down
8 changes: 2 additions & 6 deletions test/test_transforms_run_run_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,7 @@ def test_caches_exclude(run_caches):
def test_caches_project_include(run_caches):
caches = run_caches(
{},
extra_graph_config={
"taskgraph": {"run": {"include-caches": ["cargo"]}}
},
extra_graph_config={"taskgraph": {"run": {"include-caches": ["cargo"]}}},
)
assert caches == [
{"cache-name": "cargo", "directory": "/builds/worker/.cache/cargo"}
Expand All @@ -343,9 +341,7 @@ def test_caches_project_include(run_caches):
def test_caches_project_exclude(run_caches):
caches = run_caches(
{},
extra_graph_config={
"taskgraph": {"run": {"exclude-caches": ["cargo"]}}
},
extra_graph_config={"taskgraph": {"run": {"exclude-caches": ["cargo"]}}},
)
assert len(caches) == len(CACHES) - 1
assert all(c["cache-name"] != "cargo" for c in caches)

0 comments on commit 4e22fba

Please sign in to comment.