diff options
| author | zitian-gao <zitian.gao@outlook.com> | 2025-05-27 16:45:31 +0800 |
|---|---|---|
| committer | zitian-gao <zitian.gao@outlook.com> | 2025-05-27 16:45:31 +0800 |
| commit | 7c792461c8e4e4f1f8734fed143630c74e76b27f (patch) | |
| tree | cf6341ff9f2727424751da7a11a3bea6c39015bb /Qwen2.5-Eval/evaluation/latex2sympy/scripts | |
| parent | 16815c8c5ec263c4bd1a0af60030c1c0efa1421e (diff) | |
init eval
Diffstat (limited to 'Qwen2.5-Eval/evaluation/latex2sympy/scripts')
| -rwxr-xr-x | Qwen2.5-Eval/evaluation/latex2sympy/scripts/pre-commit | 28 | ||||
| -rwxr-xr-x | Qwen2.5-Eval/evaluation/latex2sympy/scripts/pre-push | 28 |
2 files changed, 56 insertions, 0 deletions
diff --git a/Qwen2.5-Eval/evaluation/latex2sympy/scripts/pre-commit b/Qwen2.5-Eval/evaluation/latex2sympy/scripts/pre-commit new file mode 100755 index 0000000..a5ae67c --- /dev/null +++ b/Qwen2.5-Eval/evaluation/latex2sympy/scripts/pre-commit @@ -0,0 +1,28 @@ +#!/bin/sh + +# Get relative path of the root directory of the project +rdir=`git rev-parse --git-dir` +rel_path="$(dirname "$rdir")" + +# Change to that path and run the file +cd $rel_path + +echo "pre-commit hook started..." + +# Activate virtual environment +echo "activating venv..." +if test -f .env/bin/activate +then source .env/bin/activate && echo "venv activated." +elif test -f .env/Scripts/activate +then source .env/Scripts/activate && echo "venv activated." +else exit 1 +fi + +# Run auto formatting on all staged python files, then add those changes +echo "auto-formatting code..." +if autopep8 --in-place `git diff --name-status --cached | grep '.py' | awk 'match($1, "A|M"){print $2}'` && git add `git diff --name-status --cached | grep '.py' | awk 'match($1, "A|M"){print $2}'` +then echo "code was auto-formatted." +else echo "no code was auto-formatted." +fi + +exit 0 diff --git a/Qwen2.5-Eval/evaluation/latex2sympy/scripts/pre-push b/Qwen2.5-Eval/evaluation/latex2sympy/scripts/pre-push new file mode 100755 index 0000000..123ce64 --- /dev/null +++ b/Qwen2.5-Eval/evaluation/latex2sympy/scripts/pre-push @@ -0,0 +1,28 @@ +#!/bin/sh + +# Get relative path of the root directory of the project +rdir=`git rev-parse --git-dir` +rel_path="$(dirname "$rdir")" + +# Change to that path and run the file +cd $rel_path + +echo "pre-push hook started..." + +# Activate virtual environment +echo "activating venv..." +if test -f .env/bin/activate +then source .env/bin/activate && echo "venv activated." +elif test -f .env/Scripts/activate +then source .env/Scripts/activate && echo "venv activated." +else exit 1 +fi + +# Run unit tests +echo "starting tests..." +# if pytest tests +# then echo "tests finished." +# else exit 1 +# fi + +exit 0 |
