From 6e64da45b3a608052919c327ec8a5fc5361193b6 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Wed, 22 Jan 2025 15:59:26 -0800 Subject: [PATCH 1/2] Set pwd for precommit to support run it in any directory --- scripts/precommit.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/precommit.sh b/scripts/precommit.sh index 0144ba8a36..1c209eedf4 100755 --- a/scripts/precommit.sh +++ b/scripts/precommit.sh @@ -1 +1,7 @@ -cargo update && cargo fmt --all && ./scripts/lint.sh && ./scripts/test.sh \ No newline at end of file +REPO_ROOT=$(dirname $( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )) + +pushd "${REPO_ROOT}" > /dev/null + +cargo update && cargo fmt --all && ./scripts/lint.sh && ./scripts/test.sh + +popd > /dev/null \ No newline at end of file From d568100f647a270f2cf7abc586f7e937ebdbc2bd Mon Sep 17 00:00:00 2001 From: Cijo Thomas Date: Fri, 7 Feb 2025 10:43:50 -0800 Subject: [PATCH 2/2] modify contributing --- CONTRIBUTING.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ae81dc5017..746e34806a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -79,8 +79,7 @@ Open a pull request against the main repo. > **Note** -> It is recommended to run [pre-commit script](scripts/precommit.sh) from the root of -the repo to catch any issues locally. +> It is recommended to run [pre-commit script](scripts/precommit.sh) to catch any issues locally. ### How to Receive Comments