Skip to content

Commit 4edba3a

Browse files
committed
Call composer cs instead of individual calls
1 parent f804b55 commit 4edba3a

File tree

2 files changed

+4
-42
lines changed

2 files changed

+4
-42
lines changed

.github/workflows/test-coding-standards.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,5 @@ jobs:
5757
- name: Install dependencies
5858
run: composer update --ansi --no-interaction
5959

60-
- name: Run lint on `app/`, `admin/`, `public/`
61-
run: utils/vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --config=.php-cs-fixer.no-header.php --using-cache=no --diff
62-
63-
- name: Run lint on `system/`, `utils/`, and root PHP files
64-
run: utils/vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --using-cache=no --diff
65-
66-
- name: Run lint on `tests`
67-
run: utils/vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --config=.php-cs-fixer.tests.php --using-cache=no --diff
68-
69-
- name: Run lint on `user_guide_src/source/`
70-
run: utils/vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --config=.php-cs-fixer.user-guide.php --using-cache=no --diff
60+
- name: Run lint
61+
run: composer cs

admin/pre-commit

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -24,39 +24,10 @@ if [ "$FILES" != "" ]; then
2424
echo "Running PHP CS Fixer..."
2525

2626
# Run on whole codebase to skip on unnecessary filtering
27-
# Run first on app, admin, public
28-
if [ -d /proc/cygdrive ]; then
29-
./utils/vendor/bin/php-cs-fixer fix --verbose --dry-run --diff --config=.php-cs-fixer.no-header.php
30-
else
31-
php ./utils/vendor/bin/php-cs-fixer fix --verbose --dry-run --diff --config=.php-cs-fixer.no-header.php
32-
fi
33-
34-
if [ $? != 0 ]; then
35-
echo "Files in app, admin, or public are not following the coding standards. Please fix them before commit."
36-
exit 1
37-
fi
38-
39-
# Next, run on system, tests, utils, and root PHP files
40-
if [ -d /proc/cygdrive ]; then
41-
./utils/vendor/bin/php-cs-fixer fix --verbose --dry-run --diff
42-
else
43-
php ./utils/vendor/bin/php-cs-fixer fix --verbose --dry-run --diff
44-
fi
45-
46-
if [ $? != 0 ]; then
47-
echo "Files in system, tests, utils, or root are not following the coding standards. Please fix them before commit."
48-
exit 1
49-
fi
50-
51-
# Next, run on user_guide_src/source PHP files
52-
if [ -d /proc/cygdrive ]; then
53-
./utils/vendor/bin/php-cs-fixer fix --verbose --dry-run --diff --config=.php-cs-fixer.user-guide.php
54-
else
55-
php ./utils/vendor/bin/php-cs-fixer fix --verbose --dry-run --diff --config=.php-cs-fixer.user-guide.php
56-
fi
27+
composer cs
5728

5829
if [ $? != 0 ]; then
59-
echo "Files in user_guide_src/source are not following the coding standards. Please fix them before commit."
30+
echo "There are PHP files which are not following the coding standards. Please fix them before commit."
6031
exit 1
6132
fi
6233
fi

0 commit comments

Comments
 (0)