Skip to content

Commit 1509ae6

Browse files
committed
Use shared cache for pre-commit hooks
Once the uv cache has been set up, configuring the pre-commit hooks takes the most significant amount of time building the container. Using a shared volume for the pre-commit cache as well takes the devcontainer re-build time from ~1m10s to ~10s.
1 parent 89f799f commit 1509ae6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

.devcontainer/devcontainer.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@
6060
"target": "/root/.cache/uv",
6161
"type": "volume"
6262
},
63+
// ...and for pre-commit
64+
{
65+
"source": "persistent-pre-commit-cache",
66+
"target": "/root/.cache/pre-commit",
67+
"type": "volume"
68+
},
6369
// Use a volume mount for the uv venv so it is local to the container
6470
{
6571
"target": "/workspaces/${localWorkspaceFolderBasename}/.venv",

0 commit comments

Comments
 (0)