Skip to content
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

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

sksaju
Copy link
Member

@sksaju sksaju commented Jul 15, 2024

Description of the Change

Closes #35

How to test the Change

Changelog Entry

Added - New feature
Changed - Existing functionality
Deprecated - Soon-to-be removed feature
Removed - Feature
Fixed - Bug fix
Security - Vulnerability

Credits

Props @username, @username2, ...

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@sksaju sksaju requested a review from a team as a code owner July 15, 2024 09:54
@sksaju sksaju requested review from iamdharmesh and removed request for a team July 15, 2024 09:54
@jeffpaul jeffpaul added this to the 1.8.0 milestone Jul 29, 2024
Copy link
Member

@iamdharmesh iamdharmesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @sksaju,

Thanks for the working on the PR. I have started testing it, but getting /action/entrypoint.sh: line 5: composer: not found error. Could you please help with checking it once?

You can find logs of action run here: https://github.com/iamdharmesh/autoshare-for-twitter/actions/runs/10319895557/job/28569247554?pr=5

Thank you.

mehul0810
mehul0810 previously approved these changes Aug 23, 2024
Copy link

@mehul0810 mehul0810 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

entrypoint.sh Outdated Show resolved Hide resolved
@thrijith thrijith force-pushed the fix/35-upgrade-wordpress-coding-standards-to-3.1 branch from 5d26790 to 85891aa Compare September 19, 2024 10:41
entrypoint.sh Outdated Show resolved Hide resolved
entrypoint.sh Outdated Show resolved Hide resolved
entrypoint.sh Outdated Show resolved Hide resolved
entrypoint.sh Outdated Show resolved Hide resolved
Copy link

@benlk benlk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that the composer-installed WPCS is available to all standards, and add PHPCSUtils to the default WPCS run.

thrijith and others added 4 commits October 4, 2024 15:31
Co-authored-by: Ben Keith <[email protected]>
Co-authored-by: Ben Keith <[email protected]>
Co-authored-by: Ben Keith <[email protected]>
Install missing sniff in config path
Update missing sniff in config path
@thrijith thrijith force-pushed the fix/35-upgrade-wordpress-coding-standards-to-3.1 branch from 5b9c999 to 5b45d2b Compare October 4, 2024 10:45
@thrijith
Copy link
Member

thrijith commented Oct 4, 2024

@benlk I made some changes but it seems to be failing https://github.com/thrijith/autoshare-for-twitter/actions/runs/10938472447/job/31076394106?pr=2#step:4:87

The error is ERROR: Referenced sniff "Generic.CodeAnalysis.RequireExplicitBooleanOperatorPrecedence" which was added 3.9.0 PHPCSStandards/PHP_CodeSniffer#343, but we are installing 3.10.3 already https://github.com/thrijith/autoshare-for-twitter/actions/runs/10938472447/job/31076394106?pr=2#step:4:25 so not sure why that would be an issue.

@jeffpaul jeffpaul requested a review from benlk October 4, 2024 13:32
entrypoint.sh Outdated
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"
Copy link
Member

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 default standard, I'm getting ERROR: Referenced sniff "Universal.NamingConventions.NoReservedKeywordParameterNames" does not exist. This occurs because PHPCSExtra's path isn't included in PHPCS's installed_paths configuration, even though it's installed globally via composer.

I think we need to add PHPCSExtra's path to the decide_all_files_or_changed call:

decide_all_files_or_changed "$(composer config home)/vendor/wp-coding-standards/wpcs,${HOME}/phpcsutils/PHPCSUtils,$(composer config home)/vendor/phpcsstandards/phpcsextra"

cc @benlk @jeffpaul

entrypoint.sh Outdated
@@ -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"
Copy link
Member

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:

decide_all_files_or_changed "$(composer config home)/vendor/wp-coding-standards/wpcs,${HOME}/vipcs,${HOME}/variable-analysis,${HOME}/phpcsutils/PHPCSUtils"

cc @benlk @jeffpaul

Copy link
Member Author

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

entrypoint.sh Show resolved Hide resolved
@jeffpaul jeffpaul requested a review from s3rgiosan December 5, 2024 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade WordPress Coding Standards to 3.0.0
7 participants