-
Notifications
You must be signed in to change notification settings - Fork 6
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 #59 from Yoast/JRF/update-yoastcs
Update to YoastCS 1.3.0
- Loading branch information
Showing
11 changed files
with
191 additions
and
550 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
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 |
---|---|---|
|
@@ -7,4 +7,6 @@ node_modules/ | |
/admin/assets/js/*.js.map | ||
.wordpress-svn/ | ||
artifact.zip | ||
artifact/ | ||
artifact/ | ||
.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
<?xml version="1.0"?> | ||
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
name="Yoast Comment Hacks" | ||
xsi:noNamespaceSchemaLocation="./vendor/squizlabs/php_codesniffer/phpcs.xsd"> | ||
|
||
<description>Yoast Comment Hacks rules for PHP_CodeSniffer</description> | ||
|
||
<!-- | ||
############################################################################# | ||
COMMAND LINE ARGUMENTS | ||
https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml | ||
############################################################################# | ||
--> | ||
|
||
<file>.</file> | ||
|
||
<!-- Only check PHP files. --> | ||
<arg name="extensions" value="php"/> | ||
|
||
<!-- Show progress, show the error codes for each message (source). --> | ||
<arg value="ps"/> | ||
|
||
<!-- 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 YoastCS RULESET | ||
############################################################################# | ||
--> | ||
|
||
<rule ref="Yoast"/> | ||
|
||
|
||
<!-- | ||
############################################################################# | ||
SNIFF SPECIFIC CONFIGURATION | ||
############################################################################# | ||
--> | ||
|
||
<!-- Verify that all gettext calls use the correct text domain. --> | ||
<rule ref="WordPress.WP.I18n"> | ||
<properties> | ||
<property name="text_domain" type="array"> | ||
<element value="yoast-comment-hacks"/> | ||
</property> | ||
</properties> | ||
</rule> | ||
|
||
<rule ref="Yoast.Files.FileName"> | ||
<properties> | ||
<!-- Don't trigger on the main file as renaming it would deactivate the plugin. --> | ||
<property name="exclude" type="array"> | ||
<element value="yoast-comment-hacks.php"/> | ||
</property> | ||
|
||
<!-- Remove the following prefixes from the names of object structures. --> | ||
<property name="prefixes" type="array"> | ||
<element value="yoast_comment"/> | ||
</property> | ||
</properties> | ||
|
||
<exclude-pattern>*/deprecated/deprecated-classes\.php$</exclude-pattern> | ||
</rule> | ||
|
||
<!-- Verify that everything in the global namespace is prefixed with a plugin specific prefix. --> | ||
<rule ref="WordPress.NamingConventions.PrefixAllGlobals"> | ||
<properties> | ||
<!-- Provide the prefixes to look for. --> | ||
<property name="prefixes" type="array"> | ||
<!-- Temporarily allowed until the prefixes are fixed. --> | ||
<element value="yoast_ch"/> | ||
<element value="yst_comment"/> | ||
|
||
<!-- These are the new prefixes which all code should comply with in the future. --> | ||
<element value="yoast_comment"/> | ||
<element value="Yoast\WP\Comment"/> | ||
</property> | ||
</properties> | ||
|
||
<exclude-pattern>*/deprecated/*\.php$</exclude-pattern> | ||
</rule> | ||
|
||
|
||
<!-- | ||
############################################################################# | ||
TEMPORARY ADJUSTMENTS | ||
Adjustments which should be removed once the associated issue has been resolved. | ||
############################################################################# | ||
--> | ||
|
||
<!-- Direct database queries need careful review. | ||
Ticket: https://github.com/Yoast/comment-hacks/issues/50 | ||
--> | ||
<rule ref="WordPress.DB.DirectDatabaseQuery"> | ||
<exclude-pattern>/admin/comment-parent\.php$</exclude-pattern> | ||
<exclude-pattern>/inc/clean-emails\.php$</exclude-pattern> | ||
<exclude-pattern>/inc/email-links\.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
phpcs.xml | ||
.phpcs.xml.dist | ||
readme.md |
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
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
Oops, something went wrong.