From cbfac5cdf411210a3b95df4383a3b6aa93ad13d9 Mon Sep 17 00:00:00 2001 From: Alex Zenla Date: Thu, 1 Feb 2024 10:36:54 +0000 Subject: [PATCH] introduce lefthook support to check commits --- hypha/bin/container.rs | 2 +- hypha/bin/controller.rs | 2 +- lefthook.toml | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 lefthook.toml diff --git a/hypha/bin/container.rs b/hypha/bin/container.rs index 595445c..7f41c0c 100644 --- a/hypha/bin/container.rs +++ b/hypha/bin/container.rs @@ -1,5 +1,5 @@ -use env_logger::Env; use anyhow::{anyhow, Result}; +use env_logger::Env; use hypha::container::init::ContainerInit; use std::env; diff --git a/hypha/bin/controller.rs b/hypha/bin/controller.rs index 9d0bf87..aa4afbb 100644 --- a/hypha/bin/controller.rs +++ b/hypha/bin/controller.rs @@ -1,6 +1,6 @@ -use env_logger::Env; use anyhow::{anyhow, Result}; use clap::{Parser, Subcommand}; +use env_logger::Env; use hypha::ctl::Controller; use std::path::PathBuf; diff --git a/lefthook.toml b/lefthook.toml new file mode 100644 index 0000000..42dd89d --- /dev/null +++ b/lefthook.toml @@ -0,0 +1,14 @@ +[pre-commit] +parallel = true + +[pre-commit.commands.build] +run = "cargo build --target x86_64-unknown-linux-gnu" + +[pre-commit.commands.test] +run = "cargo test --target x86_64-unknown-linux-gnu" + +[pre-commit.commands.fmt] +run = "cargo fmt --all -- --check" + +[pre-commit.commands.clippy] +run = "cargo clippy --target x86_64-unknown-linux-gnu"