Skip to content

Instantly share code, notes, and snippets.

@TheoOiry
Created December 6, 2022 16:59
Show Gist options
  • Save TheoOiry/4bd067ab3007c66bb14642fc0c681c8b to your computer and use it in GitHub Desktop.
Save TheoOiry/4bd067ab3007c66bb14642fc0c681c8b to your computer and use it in GitHub Desktop.
#!/bin/sh
# to put in .git/hooks/pre-commit with execution rights
set -eu
if ! cargo fmt -- --check
then
echo "There are some code style issues."
echo "Run cargo fmt first."
exit 1
fi
if ! cargo clippy --benches --tests --all-targets -- -D warnings
then
echo "There are some clippy issues."
exit 1
fi
exit 0
@NicMcPhee
Copy link

Thanks a lot for sharing this and for joining today's stream! I hope we see you again in future streams! There's also a Discord if you're so inclined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment