Skip to content
Snippets Groups Projects

feat: rewrite CS rules

Merged Krzysztof Dyszczyk requested to merge feature/new-cs-rules into master
3 files
+ 17
21
Compare changes
  • Side-by-side
  • Inline

Files

+ 7
15
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="WPDesk">
<description>Sniffs for WordPress WPDesk plugins</description>
<!-- Always exclude all files in version management related directories. -->
@@ -13,7 +14,7 @@
<!-- Always exclude all tests. Differences between PHPUnit, mocking libraries and WPCS make it hard to enforce some CS. -->
<exclude-pattern>*/tests/*</exclude-pattern>
<exclude-pattern>scoper.inc.php</exclude-pattern>
<exclude-pattern>scoper\.inc\.php$</exclude-pattern>
<rule ref="WordPress">
<!-- Follow PSR-4 for autoloading naming convention -->
@@ -26,8 +27,7 @@
<exclude name="WordPress.PHP.YodaConditions"/>
<!-- The only required comments are for the classes. -->
<exclude name="Squiz.Commenting.FunctionComment"/>
<exclude name="Squiz.Commenting.FileComment.Missing"/>
<exclude name="Squiz.Commenting.FunctionComment"/>
<exclude name="Generic.Commenting.DocComment.MissingShort"/>
<!-- You can use short if-else form. -->
@@ -47,10 +47,10 @@
</rule>
<!-- Template files should have comment with passed variables. -->
<rule ref="Squiz.Commenting.FileComment">
<include-pattern>*/templates/*</include-pattern>
<rule ref="Squiz.Commenting.FileComment">
<include-pattern>*/templates/*</include-pattern>
<exclude name="Squiz.Commenting.FileComment.MissingPackageTag"/>
</rule>
</rule>
<rule ref="WordPress.Arrays.MultipleStatementAlignment">
<type>error</type>
@@ -82,17 +82,9 @@
</properties>
</rule>
<!--
#############################################################################
SNIFF FOR PHP CROSS-VERSION COMPATIBILITY
#############################################################################
-->
<config name="testVersion" value="7.0-"/>
<rule ref="PHPCompatibility">
<rule ref="PHPCompatibilityWP">
<include-pattern>*\.php$</include-pattern>
</rule>
<!--
#############################################################################
ADD SOME SPECIFIC EXTRA SNIFFS
Loading