-
Notifications
You must be signed in to change notification settings - Fork 97
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 #1002 from WordPress/fix/997-separate-phpcs
Separate `phpcs.xml.dist` Files for Each Plugin to Isolate Text Domains Co-authored-by: mukeshpanchal27 <mukesh27@git.wordpress.org> Co-authored-by: felixarntz <flixos90@git.wordpress.org> Co-authored-by: thelovekesh <thelovekesh@git.wordpress.org> Co-authored-by: swissspidy <swissspidy@git.wordpress.org> Co-authored-by: westonruter <westonruter@git.wordpress.org> Co-authored-by: joemcgill <joemcgill@git.wordpress.org>
- Loading branch information
Showing
8 changed files
with
122 additions
and
99 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
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,93 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="WPP-Base"> | ||
<description>Sniffs for WordPress plugins</description> | ||
|
||
<rule ref="PHPCompatibility"/> | ||
<config name="testVersion" value="7.0-"/> | ||
|
||
<rule ref="WordPress-Docs"/> | ||
<rule ref="WordPress-Extra" /> | ||
<rule ref="WordPress.WP.I18n"/> | ||
|
||
<arg value="ps"/> | ||
<arg name="extensions" value="php"/> | ||
|
||
<!-- Do not require docblocks for unit tests --> | ||
<rule ref="Squiz.Commenting.FunctionComment.Missing"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
<rule ref="Squiz.Commenting.FileComment.Missing"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
<rule ref="Squiz.Commenting.ClassComment.Missing"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
<rule ref="Squiz.Commenting.ClassComment.SpacingAfter"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
<rule ref="Squiz.Commenting.FunctionComment.MissingParamTag"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
<rule ref="Generic.Commenting.DocComment.Empty"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
<rule ref="Generic.Commenting.DocComment.MissingShort"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
<rule ref="Squiz.Commenting.VariableComment.Missing"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
<rule ref="Squiz.Commenting.FunctionCommentThrowTag.Missing"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
|
||
<!-- Do not apply filename rules for unit tests and object cache --> | ||
<rule ref="WordPress.Files.FileName.NotHyphenatedLowercase"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
<rule ref="WordPress.Files.FileName.InvalidClassFileName"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
|
||
<!-- Do not apply compatibility rules to allow using the modern PHPUnit functionality --> | ||
<rule ref="PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.stringFound"> | ||
<exclude-pattern>tests/utils/*</exclude-pattern> | ||
</rule> | ||
<rule ref="PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.boolFound"> | ||
<exclude-pattern>tests/utils/*</exclude-pattern> | ||
</rule> | ||
|
||
<!-- Ignore inapplicable WordPress-Extra sniffs in tests. --> | ||
<rule ref="WordPress.WP.EnqueuedResourceParameters"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
<rule ref="WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
<rule ref="WordPress.Security.EscapeOutput.OutputNotEscaped"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
<rule ref="WordPress.WP.AlternativeFunctions.unlink_unlink"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
<rule ref="WordPress.WP.GlobalVariablesOverride.Prohibited"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
<rule ref="WordPress.PHP.DevelopmentFunctions.error_log_var_export"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
|
||
<!-- Exceptions for variable name casing. --> | ||
<rule ref="WordPress.NamingConventions.ValidVariableName"> | ||
<properties> | ||
<property name="allowed_custom_properties" type="array"> | ||
<element value="nodeValue"/> | ||
<element value="parentNode"/> | ||
<element value="createTextNode"/> | ||
<element value="textContent"/> | ||
</property> | ||
</properties> | ||
</rule> | ||
|
||
<rule ref="SlevomatCodingStandard.Functions.StaticClosure" /> | ||
</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,108 +1,23 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="WordPress Coding Standards for Performance Plugin"> | ||
<description>Sniffs for WordPress plugins, with minor modifications for Performance</description> | ||
|
||
<rule ref="PHPCompatibility"/> | ||
<config name="testVersion" value="7.0-"/> | ||
|
||
<rule ref="WordPress-Docs"/> | ||
<rule ref="WordPress-Extra" /> | ||
<rule ref="WordPress.WP.I18n"/> | ||
<config name="text_domain" value="performance-lab,default,auto-sizes"/> | ||
|
||
<arg value="ps"/> | ||
<arg name="extensions" value="php"/> | ||
|
||
<file>./admin</file> | ||
<file>./load.php</file> | ||
<file>./modules</file> | ||
<file>./plugins</file> | ||
<file>./server-timing</file> | ||
<file>./tests</file> | ||
<ruleset name="WPP-PerfLab"> | ||
<description>WordPress Coding Standards for the Performance Lab Plugin</description> | ||
<rule ref="phpcs.ruleset.xml"/> | ||
|
||
<config name="text_domain" value="performance-lab,default"/> | ||
|
||
<!-- Do not require file headers on generated files --> | ||
<rule ref="Squiz.Commenting.FileComment.WrongStyle"> | ||
<exclude-pattern>default-enabled-modules.php</exclude-pattern> | ||
<exclude-pattern>module-i18n.php</exclude-pattern> | ||
</rule> | ||
|
||
<!-- Do not require docblocks for unit tests --> | ||
<rule ref="Squiz.Commenting.FunctionComment.Missing"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
<rule ref="Squiz.Commenting.FileComment.Missing"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
<rule ref="Squiz.Commenting.ClassComment.Missing"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
<rule ref="Squiz.Commenting.ClassComment.SpacingAfter"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
<rule ref="Squiz.Commenting.FunctionComment.MissingParamTag"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
<rule ref="Generic.Commenting.DocComment.Empty"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
<rule ref="Generic.Commenting.DocComment.MissingShort"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
<rule ref="Squiz.Commenting.VariableComment.Missing"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
<rule ref="Squiz.Commenting.FunctionCommentThrowTag.Missing"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
|
||
<!-- Do not apply filename rules for unit tests and object cache --> | ||
<rule ref="WordPress.Files.FileName.NotHyphenatedLowercase"> | ||
<exclude-pattern>server-timing/object-cache.copy.php</exclude-pattern> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
<rule ref="WordPress.Files.FileName.InvalidClassFileName"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
|
||
<!-- Do not apply compatibility rules to allow using the modern PHPUnit functionality --> | ||
<rule ref="PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.stringFound"> | ||
<exclude-pattern>tests/utils/*</exclude-pattern> | ||
</rule> | ||
<rule ref="PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.boolFound"> | ||
<exclude-pattern>tests/utils/*</exclude-pattern> | ||
</rule> | ||
|
||
<!-- Ignore inapplicable WordPress-Extra sniffs in tests. --> | ||
<rule ref="WordPress.WP.EnqueuedResourceParameters"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
<rule ref="WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
<rule ref="WordPress.Security.EscapeOutput.OutputNotEscaped"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
<rule ref="WordPress.WP.AlternativeFunctions.unlink_unlink"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
<rule ref="WordPress.WP.GlobalVariablesOverride.Prohibited"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
<rule ref="WordPress.PHP.DevelopmentFunctions.error_log_var_export"> | ||
<exclude-pattern>tests/*</exclude-pattern> | ||
</rule> | ||
|
||
<!-- Exceptions for variable name casing. --> | ||
<rule ref="WordPress.NamingConventions.ValidVariableName"> | ||
<properties> | ||
<property name="allowed_custom_properties" type="array"> | ||
<element value="nodeValue"/> | ||
<element value="parentNode"/> | ||
<element value="createTextNode"/> | ||
<element value="textContent"/> | ||
</property> | ||
</properties> | ||
</rule> | ||
|
||
<rule ref="SlevomatCodingStandard.Functions.StaticClosure" /> | ||
<file>.</file> | ||
<exclude-pattern>./build/*</exclude-pattern> | ||
<exclude-pattern>./node_modules/*</exclude-pattern> | ||
<exclude-pattern>./plugins/*</exclude-pattern> | ||
<exclude-pattern>./vendor/*</exclude-pattern> | ||
</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 |
---|---|---|
|
@@ -34,4 +34,3 @@ | |
|
||
// Start up the WP testing environment. | ||
require $_test_root . '/includes/bootstrap.php'; | ||
|
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,10 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="WPP-AutoSizes"> | ||
<description>WordPress Coding Standards for Auto-sizes for Lazy-loaded Images Plugin</description> | ||
|
||
<rule ref="../../phpcs.ruleset.xml"/> | ||
|
||
<config name="text_domain" value="auto-sizes"/> | ||
|
||
<file>.</file> | ||
</ruleset> |