From 189aaf53b54757d739dbf6943b14aa74ca61e438 Mon Sep 17 00:00:00 2001 From: TerraMaster85 Date: Tue, 9 Jan 2024 19:09:17 -0500 Subject: [PATCH] Newer & better pre-commit hook (.git-hooks) --- .git-hooks/pre-commit | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/.git-hooks/pre-commit b/.git-hooks/pre-commit index 41735acb5a17c1f55bb18e5aad13430e72475941..82426446359500ca1f7a9bebbf0a57c3adee49e5 100755 --- a/.git-hooks/pre-commit +++ b/.git-hooks/pre-commit @@ -1,14 +1,3 @@ #!/bin/bash -echo "Checking your formatting..." -rustfmt server/src/*.rs --edition 2021 --check -if [ $? -ne 0 ]; then - echo "Uh oh, looks like your formatting is off! Run 'rustfmt server/src/*.rs --edition 2021' to fix it." - exit 1 -fi -cd starkingdoms-client && yarn prettier . --check -if [ $? -ne 0 ]; then - echo "Uh oh, looks like your formatting is off! Run 'cd starkingdoms-client && yarn prettier . --write' to fix it." - exit 1 -fi -echo "Everything looks good! Proceeding with commit..." -exit 0 +cargo fmt +cd starkingdoms-client && yarn prettier . --write