Skip to content

Conversation

@jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Apr 17, 2019

This basically adds a PHPCS ruleset using the new WPCliCSstandard, fixes a few minor infractions and whitelists some others.

Please see the individual commits for more detail.

The build for this PR won't be able to pass until wp-cli-tests 2.1 has been released, upon which time, the build can just be restarted and should be green ;-)

[Edit]: this PR presumes that the https://github.com/wp-cli/cache-command/tree/prefix-global-variables branch will be pulled & merged before that time. /cc @schlessera

Fixes #55

Related wp-cli/wp-cli#5179

@jrfnl jrfnl requested a review from a team as a code owner April 17, 2019 14:56
@jrfnl jrfnl force-pushed the feature/use-phpcs branch 2 times, most recently from 47e3329 to a9ddc76 Compare April 17, 2019 16:33
jrfnl added 5 commits April 19, 2019 16:44
... as that version contains the new WPCliCS PHPCS standard.
* `.distignore`: no need to distribute the phpcs/phpunit config files.
* `.gitignore`: Allow devs to overwrite config files for PHPUnit and PHPCS
    - The `.dist` files should be committed. However, for their personal use, devs can overrule those files with versions without `.dist`.
        Those personal versions should never be committed.

As a side-note: for PHPCS, having a personal version while still using the original `.dist` file is made very easy, as you can just import the `.dist` file as a starting point, like so:
```xml
<?xml version="1.0"?>
<ruleset name="WP-CLI">
    <rule ref="./phpcs.xml.dist"/>
</ruleset>
```
The file is completely documented in-line.
Only minimal changes needed.
@jrfnl jrfnl force-pushed the feature/use-phpcs branch from a9ddc76 to 77c232d Compare April 19, 2019 14:44
@schlessera schlessera added this to the 2.0.2 milestone Apr 19, 2019
@schlessera schlessera merged commit 56e2a81 into wp-cli:master Apr 19, 2019
@schlessera schlessera changed the title Implement CS checking based on the WPCliCS ruleset Implement CS checking based on the WP_CLI_CS ruleset Apr 19, 2019
@jrfnl jrfnl deleted the feature/use-phpcs branch April 19, 2019 15:15
schlessera added a commit that referenced this pull request Dec 23, 2021
Implement CS checking based on the WPCliCS ruleset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adopt and enforce new WP_CLI_CS standard

2 participants