From 92e9bed9b6ce407c41f58bdd44f4a1d554ef35ba Mon Sep 17 00:00:00 2001 From: Ciphercat <78522797+0xrsydn@users.noreply.github.com> Date: Thu, 5 Mar 2026 17:23:43 +0000 Subject: [PATCH] ci: add prek hooks for pre-commit and pre-push Pre-commit: trailing whitespace, EOF fixer, merge conflict check, cargo fmt --check, cargo clippy -D warnings Pre-push: cargo nextest run --- prek.toml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 prek.toml diff --git a/prek.toml b/prek.toml new file mode 100644 index 0000000..c63f65e --- /dev/null +++ b/prek.toml @@ -0,0 +1,34 @@ +# prek.toml — pre-commit & pre-push hooks for idx-cli + +[[repos]] +repo = "builtin" +hooks = [ + { id = "trailing-whitespace" }, + { id = "end-of-file-fixer" }, + { id = "check-merge-conflict" }, +] + +[[repos]] +repo = "local" + +[[repos.hooks]] +id = "cargo-fmt" +name = "cargo fmt" +entry = "cargo fmt --check" +language = "system" +types = ["rust"] +pass_filenames = false + +[[repos.hooks]] +id = "cargo-clippy" +name = "cargo clippy" +entry = "cargo clippy -- -D warnings" +language = "system" +types = ["rust"] +pass_filenames = false + +[[repos]] +repo = "local" +hooks = [ + { id = "cargo-test", name = "cargo test", entry = "cargo nextest run", language = "system", types = ["rust"], pass_filenames = false, stages = ["pre-push"] }, +]