Skip to content
Snippets Groups Projects

Draft: feat: add YoastCS for WP Desk Sniffer

Closed Krzysztof Dyszczyk requested to merge feature/add-yoast-cs into master
2 files
+ 34
20
Compare changes
  • Side-by-side
  • Inline

Files

@@ -2,30 +2,43 @@
<ruleset name="WPDeskPlugin">
<description>Sniffs for WordPress WPDesk plugins</description>
<config name="testVersion" value="5.6-"/>
<arg name="extensions" value="php"/>
<exclude-pattern>tests/*</exclude-pattern>
<exclude-pattern>scoper.inc.php</exclude-pattern>
<rule ref="PHPCompatibility"/>
<rule ref="WordPress"/>
<arg name="extensions" value="php"/>
<!-- Set the minimum supported WP version. This is used by several sniffs.
The minimum version set here should be in line with the minimum WP version
as set in the "Requires at least" tag in the readme.txt file. -->
<config name="minimum_supported_wp_version" value="5.0"/>
<rule ref="Yoast">
<exclude name="Yoast.NamingConventions.ValidHookName"/>
<!-- Stick to PSR-4 -->
<exclude name="Yoast.Files.FileName"/>
<exclude name="Yoast.NamingConventions.NamespaceName"/>
<exclude name="Yoast.Files.TestDoubles"/>
<exclude name="Yoast.ControlStructures.IfElseDeclaration.NewLine"/>
<!-- Overwrite PHPCompatibility for PHP 7.0 -->
<exclude name="PHPCompatibility"/>
<!-- Do not demand function or file comments. Rely on strong typing and descriptive names instead. -->
<exclude name="Squiz.Commenting.FunctionComment"/>
<exclude name="Generic.Commenting.DocComment.MissingShort"/>
<exclude name="Yoast.Commenting.FileComment.Missing"/>
</rule>
<!-- Remove checking if classes are in class- files -->
<rule ref="WordPress.Files.FileName">
<exclude-pattern>/class*/.*\.php</exclude-pattern>
</rule>
<exclude-pattern>scoper.inc.php</exclude-pattern>
<rule ref="WordPress.Files.FileName.InvalidClassFileName">
<exclude-pattern>/class*/.*\.php</exclude-pattern>
<!-- Use less strict commenting rules for tests, but still apply most of them. -->
<rule ref="Squiz.Commenting.ClassComment.Missing">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="WordPress.NamingConventions.ValidVariableName">
<exclude-pattern>/class*/.*\.php</exclude-pattern>
<rule ref="Squiz.Commenting.InlineComment.InvalidEndChar">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="Generic.Commenting.DocComment.MissingShort">
<exclude-pattern>\.php</exclude-pattern>
<rule ref="WordPress.Security">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<config name="testVersion" value="7.0-"/>
<rule ref="PHPCompatibility" />
</ruleset>
Loading