Giter Site home page Giter Site logo

Update to WPCS 3.0.0 about wp-cli-tests HOT 8 CLOSED

wp-cli avatar wp-cli commented on May 26, 2024
Update to WPCS 3.0.0

from wp-cli-tests.

Comments (8)

schlessera avatar schlessera commented on May 26, 2024 1

This can be run from the wp-cli-dev repo to quickly assess all packages [...]

I also use that script for doing things like this in a case like the above (built from memory and untested):

./foreach-bundle "git checkout -b fix/wpcs-3.0-issues"
./foreach-bundle "composer require --quiet --dev wp-cli/wp-cli-tests:^4 -W"
./foreach-bundle "git add composer.*"
./foreach-bundle "git commit -m 'Update to WPCS v3'"
./foreach-bundle "vendor/bin/phpcbf"
./foreach-bundle "git add --all"
./foreach-bundle "git commit -m 'Fix all autofixable CS issues'"
./foreach-bundle "hub pull-request -m 'Update to WPCS v3' -l 'scope:testing' -m 'Auto-generated PR that updates WPCS to the latest v3 and then runs PHPCBF to fix all automatically fixable issues.'"

This will create a pull request in each bundle repository. Those that pass their tests can be merged right away, the others will be starting points for additional commits to fix any remaining issues.

This has been the most scalable way for working on bundle-wide changes for me.

from wp-cli-tests.

swissspidy avatar swissspidy commented on May 26, 2024

This can be run from the wp-cli-dev repo to quickly assess all packages:

./foreach-bundle "composer require --quiet --dev wp-cli/wp-cli-tests:^4"
./foreach-bundle "composer phpcs"

This way we can identify additional things we might want to add to the default PHPCS config, like for example https://github.com/wp-cli/wp-cli-tests/pull/176/files#r1310157136

At first glance it appears that most of the errors can be auto-fixed, reducing the amount of manual work involved with updating.

Edit: looks like you already tagged a new release; so I updated the command accordingly.

from wp-cli-tests.

danielbachhuber avatar danielbachhuber commented on May 26, 2024

I'm getting an odd warning with phpcbf...

$ composer phpcbf
> run-phpcbf-cleanup

Deprecated: Creation of dynamic property WordPressCS\WordPress\Sniffs\PHP\NoSilencedErrorsSniff::$use_default_whitelist is deprecated in /Users/danielbachhuber/Desktop/admin-command/vendor/squizlabs/php_codesniffer/src/Ruleset.php on line 1331
. 1 / 1 (100%)

Edit: looks like you already tagged a new release; so I updated the command accordingly.

Yeah, I had to tag in order to start updating the dependencies.

This way we can identify additional things we might want to add to the default PHPCS config, like for example https://github.com/wp-cli/wp-cli-tests/pull/176/files#r1310157136

Want to submit a PR for that?

from wp-cli-tests.

swissspidy avatar swissspidy commented on May 26, 2024

I'm getting an odd warning with phpcbf...

You need to renameuse_default_whitelist to usePHPFunctionsList here:

<rule ref="WordPress.PHP.NoSilencedErrors">
<properties>
<property name="use_default_whitelist" value="true"/>
</properties>
</rule>

Want to submit a PR for that?

I think we can do all of these ruleset updates in a single PR

from wp-cli-tests.

danielbachhuber avatar danielbachhuber commented on May 26, 2024

I think we can do all of these ruleset updates in a single PR

@swissspidy Sure... are you doing that?

from wp-cli-tests.

swissspidy avatar swissspidy commented on May 26, 2024

Started a PR here: #177

from wp-cli-tests.

schlessera avatar schlessera commented on May 26, 2024

I can run the above (and adapt as needed to create all initial PRs now. Let me do those, and then we can see what else might still need fixing.

from wp-cli-tests.

danielbachhuber avatar danielbachhuber commented on May 26, 2024

🎉

from wp-cli-tests.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.