Skip to content

Commit 62a364c

Browse files
committed
use pre-commit again
1 parent c5fc36f commit 62a364c

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

.github/workflows/codestyle-check.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ jobs:
4444
with:
4545
python-version: "3.13"
4646

47-
- name: Install prek
47+
- name: Install pre-commit
4848
run: |
49-
uv tool install prek
49+
uv tool install pre-commit
5050
51-
- name: Run prek
51+
- name: Run pre-commit
5252
run: |
5353
set +e
5454
bash -x ci_scripts/check_code.sh;EXCODE=$?

ci_scripts/check_code.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ diff_files=$(git diff --name-only --diff-filter=ACMR ${BRANCH})
2626
num_diff_files=$(echo "$diff_files" | wc -l)
2727
echo -e "diff files between pr and ${BRANCH}:\n${diff_files}"
2828

29-
echo "Checking code style by prek ..."
30-
prek run --files ${diff_files};check_error=$?
29+
echo "Checking code style by pre-commit ..."
30+
pre-commit run --files ${diff_files};check_error=$?
3131

3232
if test ! -z "$(git diff)"; then
3333
echo -e '\n************************************************************************************'
34-
echo -e "These files have been formatted by code format hook. You should use prek to \
34+
echo -e "These files have been formatted by code format hook. You should use pre-commit to \
3535
format them before git push."
3636
echo -e '************************************************************************************\n'
3737
git diff 2>&1
@@ -40,15 +40,15 @@ fi
4040
echo -e '\n************************************************************************************'
4141
if [ ${check_error} != 0 ];then
4242
echo "Your PR code style check failed."
43-
echo "Please install prek locally and set up git hook scripts:"
43+
echo "Please install pre-commit locally and set up git hook scripts:"
4444
echo ""
45-
echo " pip install prek"
46-
echo " prek install"
45+
echo " pip install pre-commit"
46+
echo " pre-commit install"
4747
echo ""
4848
if [[ $num_diff_files -le 100 ]];then
49-
echo "Then, run prek to check codestyle issues in your PR:"
49+
echo "Then, run pre-commit to check codestyle issues in your PR:"
5050
echo ""
51-
echo " prek run --files" $(echo ${diff_files} | tr "\n" " ")
51+
echo " pre-commit run --files" $(echo ${diff_files} | tr "\n" " ")
5252
echo ""
5353
fi
5454
echo "For more information, please refer to our codestyle check guide:"

0 commit comments

Comments
 (0)