Skip to content

Commit 61f04fa

Browse files
committed
Custom cargo-husky pre-commit hook
1 parent 4b1e649 commit 61f04fa

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.cargo-husky/hooks/pre-commit

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh -xe
2+
3+
cargo clippy --features=community -- -D warnings
4+
cargo clippy --features=entreprise -- -D warnings
5+
6+
# Check fmt (protip: run 'cargo fmt --all -- --emit files' to apply format locally)
7+
cargo fmt --all -- --check

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ regex = "1.10.4"
1313
[dev-dependencies.cargo-husky]
1414
version = "1"
1515
default-features = false # Disable features which are enabled by default
16-
features = ["precommit-hook", "run-cargo-clippy", "run-cargo-fmt"]
16+
features = ["user-hooks"]
1717

1818
[build-dependencies]
1919
bindgen = "0.69.4"

0 commit comments

Comments
 (0)