Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// Allow X11 apps to run inside the container
"DISPLAY": "${localEnv:DISPLAY}",
// Put things that allow it in the persistent cache
"PRE_COMMIT_HOME": "/cache/pre-commit",
"PREK_HOME": "/cache/prek",
"UV_CACHE_DIR": "/cache/uv",
"UV_PYTHON_CACHE_DIR": "/cache/uv-python",
// Make a venv that is specific for this workspace path as the cache is shared
Expand Down Expand Up @@ -64,7 +64,7 @@
"target": "/user-terminal-config",
"type": "bind"
},
// Keep a persistent cross container cache for uv, pre-commit, and the venvs
// Keep a persistent cross container cache for uv, prek, and the venvs
{
"source": "devcontainer-shared-cache",
"target": "/cache",
Expand All @@ -73,6 +73,6 @@
],
// Mount the parent as /workspaces so we can pip install peers as editable
"workspaceMount": "source=${localWorkspaceFolder}/..,target=/workspaces,type=bind",
// After the container is created, recreate the venv then make pre-commit first run faster
"postCreateCommand": "uv venv --clear && uv sync && pre-commit install --install-hooks"
// After the container is created, recreate the venv then make prek first run faster
"postCreateCommand": "uv venv --clear && uv sync && prek install --install-hooks"
}
55 changes: 0 additions & 55 deletions .pre-commit-config.yaml

This file was deleted.

45 changes: 45 additions & 0 deletions prek.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[[repos]]
repo = "builtin"
hooks = [
{ id = "check-added-large-files", exclude = "^uv.lock$" },
{
id = "check-yaml",
exclude = "^helm/blueapi/templates",
args = ["--allow-multiple-documents"]
},
{ id = "check-merge-conflict" },
{ id = "end-of-file-fixer" },
{ id = "no-commit-to-branch" }
]

[[repos]]
repo = "https://github.com/astral-sh/ruff-pre-commit"
rev = "v0.15.1"
hooks = [
{ id = "ruff-check", args = ["--fix"] },
{ id = "ruff-format" },
]

[[repos]]
repo = "https://github.com/astral-sh/uv-pre-commit"
rev = "0.10.2"
hooks = [
{ id = "uv-sync", args = [] },
]

[[repos]]
repo = "https://github.com/norwoodj/helm-docs"
rev = "v1.14.2"
hooks = [{ id = "helm-docs-built", args = ["--chart-search-root=helm"] }]

[[repos]]
repo = "https://github.com/losisin/helm-values-schema-json"
rev = "v2.3.1"
hooks = [
{ id = "helm-schema", args = ["--config", "helm/blueapi/.schema.yaml"] }
]

[[repos]]
repo = "https://github.com/gitleaks/gitleaks"
rev = "v8.28.0"
hooks = [{ id = "gitleaks" }]
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ requires-python = ">=3.11"
dev = [
"copier",
"myst-parser",
"pre-commit",
"prek",
"pydata-sphinx-theme>=0.15.4",
"pytest",
"pyright!=1.1.407", # https://github.com/bluesky/scanspec/issues/190
Expand Down Expand Up @@ -119,10 +119,12 @@ env_list = ["pre-commit", "type-checking", "tests", "docs"]
passenv = ["*"]

[tool.tox.env.pre-commit]
description = "Run pre-commit on all files"
description = "Run pre-commit (prek) on all files"
commands = [
[
"pre-commit",
"uv",
"run",
"prek",
"run",
"--all-files",
"--show-diff-on-failure",
Expand Down
56 changes: 23 additions & 33 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading