From 5474ad7bdc6a3eae8c1eb959bbe6b02a54045ed2 Mon Sep 17 00:00:00 2001 From: Jonas Braathen Date: Tue, 3 Nov 2026 03:52:46 +0100 Subject: [PATCH] chore: add prek hooks with ruff --- prek.toml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 prek.toml diff --git a/prek.toml b/prek.toml new file mode 100644 index 0000000..12fb487 --- /dev/null +++ b/prek.toml @@ -0,0 +1,39 @@ +#:schema https://www.schemastore.org/prek.json +# Git hooks, run by prek (https://prek.j178.dev). `prek install` once per clone; CI runs +# them all (.gitea/workflows/ci.yaml). + +[[repos]] +repo = "builtin" +hooks = [ + { id = "trailing-whitespace" }, + { id = "end-of-file-fixer" }, + { id = "mixed-line-ending", args = ["--fix", "lf"] }, + { id = "fix-byte-order-marker" }, + { id = "check-added-large-files" }, + { id = "check-case-conflict" }, + { id = "check-merge-conflict" }, + { id = "check-executables-have-shebangs" }, + { id = "check-shebang-scripts-are-executable" }, + { id = "check-symlinks" }, + { id = "check-toml" }, + { id = "check-yaml" }, + { id = "detect-private-key" }, +] + +[[repos]] +repo = "https://github.com/astral-sh/ruff-pre-commit" +rev = "v0.17.3" # keep in sync with ruff in uv.lock +hooks = [ + { id = "ruff-check", args = ["--fix"] }, + { id = "ruff-format" }, +] + +[[repos]] +repo = "https://github.com/adamchainz/django-upgrade" +rev = "1.33.0" +hooks = [{ id = "django-upgrade", args = ["--target-version", "5.2"] }] + +[[repos]] +repo = "https://github.com/astral-sh/uv-pre-commit" +rev = "0.13.6" +hooks = [{ id = "uv-lock" }] # uv.lock stays in sync with pyproject.toml