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

WPCS 3.0: Fix ruleset tests #736

Closed
wants to merge 23 commits into from
Closed

WPCS 3.0: Fix ruleset tests #736

wants to merge 23 commits into from

Commits on Dec 19, 2022

  1. Composer: up the minimum PHPCS version to 3.7.1

    Add support for PHP 8.1 features, including fixing a retokenization of reserved keywords bug in PHPCS 3.7.0.
    GaryJones committed Dec 19, 2022
    Configuration menu
    Copy the full SHA
    cd7e371 View commit details
    Browse the repository at this point in the history

Commits on Dec 20, 2022

  1. Composer: rename scripts

    Brings them more into line with the Composer scripts in WPCS.
    GaryJones committed Dec 20, 2022
    Configuration menu
    Copy the full SHA
    a3acf35 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b4aa628 View commit details
    Browse the repository at this point in the history
  3. Composer: use develop branch of WPCS

    VIPCS needs to be compatible with WordPress Coding Standards 3.0.0, which is currently in development on its `develop` branch. WPCS now uses some extra dependencies, which are also in development, so we need to allow for a minimum-stability of dev. Run `composer update -W` to pull those extra dependencies in.
    GaryJones committed Dec 20, 2022
    Configuration menu
    Copy the full SHA
    8fb8805 View commit details
    Browse the repository at this point in the history
  4. Composer: Normalize the order

    Uses the composer-normalize plugin to keep a consistent order.
    GaryJones committed Dec 20, 2022
    Configuration menu
    Copy the full SHA
    5a82c31 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    2b893ca View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    0b84ea8 View commit details
    Browse the repository at this point in the history
  7. CS: Update WordPress-Extra exclusions

    WordPress-Extra will no longer use the `Generic.Arrays.DisallowShortArraySyntax` rule, but does use the improved `Universal.Arrays.DisallowShortArraySyntax` from PHPCSExtra instead, so whilst we have short array syntax being used in the VIPCS sniffs, let's continue to exclude the rule.
    GaryJones committed Dec 20, 2022
    Configuration menu
    Copy the full SHA
    b838219 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    1f6db81 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    9e6b16e View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    90a4658 View commit details
    Browse the repository at this point in the history
  11. Add Sniff::merge_custom_array()

    The previous `Sniff::merge_custom_array()` function was moved to a new Helper class in WPCS: WordPress/WordPress-Coding-Standards#2157.
    
    However, it is marked as non-public (only meant for WPCS directly), so copying into the VIPCS sniff is easiest for now.
    GaryJones committed Dec 20, 2022
    Configuration menu
    Copy the full SHA
    e948dcb View commit details
    Browse the repository at this point in the history
  12. Use PHPCSUtils MessageHelper::addMessage

    This is more tested than the WPCS Sniff::addMessage().
    GaryJones committed Dec 20, 2022
    Configuration menu
    Copy the full SHA
    2bb34af View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    03e7924 View commit details
    Browse the repository at this point in the history
  14. Composer: Add PHPCSUtils as required dependency

    VIPCS makes use of PHPCSUtils directly (such as for MessageHelper), so it should be marked as such in the Composer config.
    GaryJones committed Dec 20, 2022
    Configuration menu
    Copy the full SHA
    80ca8ab View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    5408a46 View commit details
    Browse the repository at this point in the history
  16. Disable ruleset test

    Shows up empty in Ci and locally.
    GaryJones committed Dec 20, 2022
    Configuration menu
    Copy the full SHA
    8e8792d View commit details
    Browse the repository at this point in the history
  17. Ruleset tests: update for WPCS 3.0

    The ruleset tests were failing mainly due to WordPress/WordPress-Coding-Standards#2108 which renamed some violation codes that we were excluding.
    
    The other change to account for was the replacement of a WPCS StrictComparisons sniff with a PHPCSExtras Universal sniff. The sniff in PHPCSExtra contains a fixer. As this is a risky fixer, this fixer is turned off for WPCS. The sniff in PHPCSExtra will provide metrics about loose versus strict comparisons.
    GaryJones committed Dec 20, 2022
    Configuration menu
    Copy the full SHA
    5ae2e23 View commit details
    Browse the repository at this point in the history
  18. Ruleset tests: Add label before test runs

    Make it clear which ruleset being tested, even on a test failure.
    GaryJones committed Dec 20, 2022
    Configuration menu
    Copy the full SHA
    92e10d3 View commit details
    Browse the repository at this point in the history
  19. Enable ruleset tests

    GaryJones committed Dec 20, 2022
    Configuration menu
    Copy the full SHA
    d6df86d View commit details
    Browse the repository at this point in the history
  20. Ruleset tests: Update label

    GaryJones committed Dec 20, 2022
    Configuration menu
    Copy the full SHA
    1b968b7 View commit details
    Browse the repository at this point in the history
  21. Add PHPCSExtras dependency

    Validate the PHPCS installed standards in the quick test.
    GaryJones committed Dec 20, 2022
    Configuration menu
    Copy the full SHA
    5b33691 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    ce7d0c4 View commit details
    Browse the repository at this point in the history