-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #108 from wp-cli/feature/use-phpcs
Implement CS checking based on the `WP_CLI_CS` ruleset
- Loading branch information
Showing
7 changed files
with
338 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ | |
.travis.yml | ||
behat.yml | ||
circle.yml | ||
phpcs.xml.dist | ||
phpunit.xml.dist | ||
bin/ | ||
features/ | ||
utils/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,6 @@ vendor/ | |
*.tar.gz | ||
composer.lock | ||
*.log | ||
phpunit.xml | ||
phpcs.xml | ||
.phpcs.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="WP-CLI-package"> | ||
<description>Custom ruleset for WP-CLI package-command</description> | ||
|
||
<!-- | ||
############################################################################# | ||
COMMAND LINE ARGUMENTS | ||
For help understanding this file: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml | ||
For help using PHPCS: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage | ||
############################################################################# | ||
--> | ||
|
||
<!-- What to scan. --> | ||
<file>.</file> | ||
|
||
<!-- Ignoring select files/folders. | ||
https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#ignoring-files-and-folders --> | ||
<exclude-pattern>*/src/WP_CLI/JsonManipulator\.php$</exclude-pattern> | ||
<exclude-pattern>*/tests/test-json-manipulator\.php$</exclude-pattern> | ||
|
||
<!-- Show progress. --> | ||
<arg value="p"/> | ||
|
||
<!-- Strip the filepaths down to the relevant bit. --> | ||
<arg name="basepath" value="./"/> | ||
|
||
<!-- Check up to 8 files simultaneously. --> | ||
<arg name="parallel" value="8"/> | ||
|
||
<!-- | ||
############################################################################# | ||
USE THE WP_CLI_CS RULESET | ||
############################################################################# | ||
--> | ||
|
||
<rule ref="WP_CLI_CS"/> | ||
|
||
<!-- | ||
############################################################################# | ||
PROJECT SPECIFIC CONFIGURATION FOR SNIFFS | ||
############################################################################# | ||
--> | ||
|
||
<!-- For help understanding the `testVersion` configuration setting: | ||
https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions --> | ||
<config name="testVersion" value="5.4-"/> | ||
|
||
<!-- Verify that everything in the global namespace is either namespaced or prefixed. | ||
See: https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#naming-conventions-prefix-everything-in-the-global-namespace --> | ||
<rule ref="WordPress.NamingConventions.PrefixAllGlobals"> | ||
<properties> | ||
<property name="prefixes" type="array"> | ||
<element value="WP_CLI\Package"/><!-- Namespaces. --> | ||
<element value="wpcli_package"/><!-- Global variables and such. --> | ||
</property> | ||
</properties> | ||
</rule> | ||
|
||
<!-- Exclude existing classes from the prefix rule as it would break BC to prefix them now. --> | ||
<rule ref="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound"> | ||
<exclude-pattern>*/src/Package_Command\.php$</exclude-pattern> | ||
</rule> | ||
|
||
</ruleset> |
Oops, something went wrong.