Repository: bearcove/loona (language: rust)

Issue:
Add httpwg-gen pre-commit hook
Should be really cheap in most cases.


Discussion / hints:

Fix patch:
diff --git a/.cargo-husky/hooks/pre-commit b/.cargo-husky/hooks/pre-commit
new file mode 100755
index 00000000..7c5e2170
--- /dev/null
+++ b/.cargo-husky/hooks/pre-commit
@@ -0,0 +1,3 @@
+#!/bin/bash -eux
+cargo run --release --package httpwg-gen
+git diff --exit-code
diff --git a/Cargo.lock b/Cargo.lock
index 652e1602..1a52d436 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -89,6 +89,12 @@ version = "1.5.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223"
 
+[[package]]
+name = "cargo-husky"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7b02b629252fe8ef6460461409564e2c21d0c8e77e0944f3d189ff06c4e932ad"
+
 [[package]]
 name = "cc"
 version = "1.0.90"
@@ -202,6 +208,7 @@ version = "0.1.0"
 dependencies = [
  "byteorder",
  "bytes",
+ "cargo-husky",
  "color-eyre",
  "eyre",
  "fluke-buffet",
diff --git a/crates/fluke/Cargo.toml b/crates/fluke/Cargo.toml
index 2ab0314b..38e1c7c3 100644
--- a/crates/fluke/Cargo.toml
+++ b/crates/fluke/Cargo.toml
@@ -62,3 +62,4 @@ libc = "0.2.153"
 httpwg = { path = "../httpwg" }
 color-eyre = "0.6.3"
 httpwg-macros = { path = "../httpwg-macros" }
+cargo-husky = { version = "1", features = ["user-hooks"] }


Test patch: