From 11dba868d7342800382471cf829ecfdaad212991 Mon Sep 17 00:00:00 2001 From: "Alisher A. Khassanov" Date: Fri, 22 Sep 2023 13:20:50 +0600 Subject: [PATCH] Pre-push script invoking Clippy linter --- scripts/pre-push.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 scripts/pre-push.sh diff --git a/scripts/pre-push.sh b/scripts/pre-push.sh new file mode 100755 index 000000000..9c6679c02 --- /dev/null +++ b/scripts/pre-push.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +# Check code with clippy before publishing +cargo clippy --all --all-targets -- -D warnings +if [ $? -ne 0 ]; then + echo "Run \`cargo clippy --fix --all --allow-staged --allow-dirty\` to apply clippy's suggestions." + exit 1 +fi