Call composer cs instead of individual calls

This commit is contained in:
John Paul E. Balandan, CPA 2024-07-24 18:49:12 +08:00
parent f804b55a94
commit 4edba3ae9e
No known key found for this signature in database
GPG Key ID: 697D84680E3738DA
2 changed files with 4 additions and 42 deletions

View File

@ -57,14 +57,5 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: composer update --ansi --no-interaction run: composer update --ansi --no-interaction
- name: Run lint on `app/`, `admin/`, `public/` - name: Run lint
run: utils/vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --config=.php-cs-fixer.no-header.php --using-cache=no --diff run: composer cs
- name: Run lint on `system/`, `utils/`, and root PHP files
run: utils/vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --using-cache=no --diff
- name: Run lint on `tests`
run: utils/vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --config=.php-cs-fixer.tests.php --using-cache=no --diff
- name: Run lint on `user_guide_src/source/`
run: utils/vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --config=.php-cs-fixer.user-guide.php --using-cache=no --diff

View File

@ -24,39 +24,10 @@ if [ "$FILES" != "" ]; then
echo "Running PHP CS Fixer..." echo "Running PHP CS Fixer..."
# Run on whole codebase to skip on unnecessary filtering # Run on whole codebase to skip on unnecessary filtering
# Run first on app, admin, public composer cs
if [ -d /proc/cygdrive ]; then
./utils/vendor/bin/php-cs-fixer fix --verbose --dry-run --diff --config=.php-cs-fixer.no-header.php
else
php ./utils/vendor/bin/php-cs-fixer fix --verbose --dry-run --diff --config=.php-cs-fixer.no-header.php
fi
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo "Files in app, admin, or public are not following the coding standards. Please fix them before commit." echo "There are PHP files which are not following the coding standards. Please fix them before commit."
exit 1
fi
# Next, run on system, tests, utils, and root PHP files
if [ -d /proc/cygdrive ]; then
./utils/vendor/bin/php-cs-fixer fix --verbose --dry-run --diff
else
php ./utils/vendor/bin/php-cs-fixer fix --verbose --dry-run --diff
fi
if [ $? != 0 ]; then
echo "Files in system, tests, utils, or root are not following the coding standards. Please fix them before commit."
exit 1
fi
# Next, run on user_guide_src/source PHP files
if [ -d /proc/cygdrive ]; then
./utils/vendor/bin/php-cs-fixer fix --verbose --dry-run --diff --config=.php-cs-fixer.user-guide.php
else
php ./utils/vendor/bin/php-cs-fixer fix --verbose --dry-run --diff --config=.php-cs-fixer.user-guide.php
fi
if [ $? != 0 ]; then
echo "Files in user_guide_src/source are not following the coding standards. Please fix them before commit."
exit 1 exit 1
fi fi
fi fi