-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #35 | Upgrade WordPress Coding Standards to 3.1.0 #49
base: develop
Are you sure you want to change the base?
Changes from 10 commits
5dad114
4099d69
4b76bb2
fc391b4
5b9fd92
85891aa
a0ce390
356712c
cf4359a
5b45d2b
5fdb314
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,16 @@ | |
|
||
cp /action/problem-matcher.json /github/workflow/problem-matcher.json | ||
|
||
git clone --depth 1 -b 2.3.0 https://github.com/WordPress/WordPress-Coding-Standards.git ~/wpcs | ||
# Install Composer if not found | ||
if ! [ -x "$(command -v composer)" ]; then | ||
echo 'Composer not found, installing...' | ||
curl -sS https://getcomposer.org/installer | php | ||
mv composer.phar /usr/local/bin/composer | ||
fi | ||
|
||
composer global config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true | ||
composer global require --dev phpcsstandards/phpcsextra:"^1.2.0" | ||
composer global require --dev wp-coding-standards/wpcs:"^3.0.0" --update-with-dependencies | ||
|
||
git config --global --add safe.directory $(pwd) | ||
|
||
|
@@ -105,7 +114,7 @@ if [ "${INPUT_STANDARD}" = "WordPress-VIP-Go" ] || [ "${INPUT_STANDARD}" = "Word | |
git clone --depth 1 -b 2.3.3 https://github.com/Automattic/VIP-Coding-Standards.git ${HOME}/vipcs | ||
git clone https://github.com/sirbrillig/phpcs-variable-analysis ${HOME}/variable-analysis | ||
|
||
decide_all_files_or_changed "${HOME}/wpcs,${HOME}/vipcs,${HOME}/variable-analysis" | ||
decide_all_files_or_changed "$(composer config home)/vendor/wp-coding-standards/wpcs,${HOME}/vipcs,${HOME}/variable-analysis" | ||
elif [ "${INPUT_STANDARD}" = "10up-Default" ]; then | ||
echo "Setting up 10up-Default" | ||
git clone https://github.com/10up/phpcs-composer ${HOME}/10up | ||
|
@@ -116,14 +125,16 @@ elif [ "${INPUT_STANDARD}" = "10up-Default" ]; then | |
git clone https://github.com/Automattic/VIP-Coding-Standards ${HOME}/vipcs | ||
git clone https://github.com/sirbrillig/phpcs-variable-analysis ${HOME}/variable-analysis | ||
|
||
decide_all_files_or_changed "${HOME}/wpcs,${HOME}/10up/10up-Default,${HOME}/phpcompatwp/PHPCompatibilityWP,${HOME}/phpcompat/PHPCompatibility,${HOME}/phpcompat-paragonie/PHPCompatibilityParagonieSodiumCompat,${HOME}/phpcompat-paragonie/PHPCompatibilityParagonieRandomCompat,${HOME}/phpcsutils/PHPCSUtils,${HOME}/vipcs,${HOME}/variable-analysis" | ||
decide_all_files_or_changed "$(composer config home)/vendor/wp-coding-standards/wpcs,${HOME}/10up/10up-Default,${HOME}/phpcompatwp/PHPCompatibilityWP,${HOME}/phpcompat/PHPCompatibility,${HOME}/phpcompat-paragonie/PHPCompatibilityParagonieSodiumCompat,${HOME}/phpcompat-paragonie/PHPCompatibilityParagonieRandomCompat,${HOME}/phpcsutils/PHPCSUtils,$(composer config home)/vendor/phpcsstandards/phpcsextra,${HOME}/vipcs,${HOME}/variable-analysis" | ||
sksaju marked this conversation as resolved.
Show resolved
Hide resolved
|
||
elif [ -z "${INPUT_STANDARD_REPO}" ] || [ "${INPUT_STANDARD_REPO}" = "false" ]; then | ||
decide_all_files_or_changed "${HOME}/wpcs" | ||
echo "Setting up default WPCS" | ||
git clone --depth 1 --branch 1.0.11 https://github.com/PHPCSStandards/PHPCSUtils ${HOME}/phpcsutils | ||
decide_all_files_or_changed "$(composer config home)/vendor/wp-coding-standards/wpcs,${HOME}/phpcsutils/PHPCSUtils" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @sksaju, when using the default standard, I'm getting I think we need to add PHPCSExtra's path to the
|
||
else | ||
echo "Standard repository: ${INPUT_STANDARD_REPO}" | ||
git clone -b ${INPUT_REPO_BRANCH} ${INPUT_STANDARD_REPO} ${HOME}/cs | ||
|
||
decide_all_files_or_changed "${HOME}/wpcs,${HOME}/cs" | ||
decide_all_files_or_changed "$(composer config home)/vendor/wp-coding-standards/wpcs,${HOME}/cs" | ||
fi | ||
|
||
if [ -z "${INPUT_EXCLUDES}" ]; then | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @sksaju, when using the WordPress-VIP-Go standard, I'm getting
ERROR: Referenced sniff "WordPress.PHP.StrictComparisons" does not exist
. This occurs because the action is missing the PHPCSUtils path in its configuration.I think we need to add PHPCSUtils to the
decide_all_files_or_changed
paths:cc @benlk @jeffpaul
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@s3rgiosan I've updated the PR, could you take another look, please? Thank you