From 281d0ec3349805bc3fed44b29c6baeb014c06c0b Mon Sep 17 00:00:00 2001 From: Mateusz Gbiorczyk <mateusz@gbiorczyk.pl> Date: Fri, 21 May 2021 13:27:49 +0200 Subject: [PATCH] feat: Updated rules for PHPCS --- phpcs.xml.dist | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 3a67263..af121e6 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -1,11 +1,33 @@ <?xml version="1.0"?> <ruleset name="WordPress Coding Standards for WP Desk Plugin"> + <config name="installed_paths" value="vendor/phpcompatibility/php-compatibility,vendor/wp-coding-standards/wpcs" /> + <config name="testVersion" value="7.0-" /> + <config name="text_domain" value="enter-plugin-text-domain-here" /> - <config name="text_domain" value="enter-plugin-text-domain-here"/> + <arg name="extensions" value="php" /> - <exclude-pattern>tests/*</exclude-pattern> - <exclude-pattern>scoper.inc.php</exclude-pattern> + <file>./src</file> + <file>./templates</file> - <rule ref="WPDeskPlugin"/> + <rule ref="PHPCompatibility" /> + <rule ref="WordPress" /> + <rule ref="WordPress-Extra"> + <exclude name="Generic.Arrays.DisallowShortArraySyntax" /> + <exclude name="Squiz.Commenting.FunctionComment.ParamCommentFullStop" /> + <exclude name="Squiz.Commenting.FunctionComment.EmptyThrows" /> + <exclude name="Squiz.Commenting.FunctionCommentThrowTag.WrongNumber" /> + <exclude name="Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure" /> + <exclude name="WordPress.CodeAnalysis.AssignmentInCondition.Found" /> + <exclude name="WordPress.Files.FileName" /> + <exclude name="WordPress.Files.FileName.InvalidClassFileName" /> + <exclude name="WordPress.PHP.DisallowShortTernary" /> + <exclude name="WordPress.PHP.YodaConditions" /> + <exclude name="WordPress.PHP.StrictInArray.MissingTrueStrict" /> + <exclude name="WordPress.WP.AlternativeFunctions" /> + <exclude name="WordPress.WP.CronInterval.ChangeDetected" /> + </rule> + <rule ref="Squiz.Commenting.FileComment.Missing"> + <exclude-pattern>./src</exclude-pattern> + </rule> </ruleset> -- GitLab