Skip to content

Commit e709546

Browse files
committed
chore: add checking on user guide PHP coding style
1 parent 848a723 commit e709546

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

admin/pre-commit

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,18 @@ if [ "$FILES" != "" ]; then
6363
echo "Files in system, tests, utils, or root are not following the coding standards. Please fix them before commit."
6464
exit 1
6565
fi
66+
67+
# Next, run on user_guide_src/source PHP files
68+
if [ -d /proc/cygdrive ]; then
69+
./vendor/bin/php-cs-fixer fix --verbose --dry-run --diff --config=.user-guide.php-cs-fixer.dist.php
70+
else
71+
php ./vendor/bin/php-cs-fixer fix --verbose --dry-run --diff --config=.user-guide.php-cs-fixer.dist.php
72+
fi
73+
74+
if [ $? != 0 ]; then
75+
echo "Files in user_guide_src/source are not following the coding standards. Please fix them before commit."
76+
exit 1
77+
fi
6678
fi
6779

6880
if [ "$STAGED_RST_FILES" != "" ]; then

0 commit comments

Comments
 (0)