-
Notifications
You must be signed in to change notification settings - Fork 25
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 #62 from wp-cli/feature/use-phpcs
Implement CS checking based on the `WP_CLI_CS` ruleset
- Loading branch information
Showing
9 changed files
with
118 additions
and
55 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-checksum"> | ||
<description>Custom ruleset for WP-CLI checksum-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> | ||
|
||
<!-- 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\Checksum"/><!-- Namespaces. --> | ||
<element value="wpcli_checksum"/><!-- 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/(Plugin_|Core_)Command_Namespace\.php$</exclude-pattern> | ||
<exclude-pattern>*/src/Checksum_(Plugin|Core|Base)_Command\.php$</exclude-pattern> | ||
</rule> | ||
|
||
<rule ref="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedNamespaceFound"> | ||
<exclude-pattern>*/src/WP_CLI/Fetchers/UnfilteredPlugin\.php$</exclude-pattern> | ||
</rule> | ||
|
||
</ruleset> |
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
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