Skip to content
Snippets Groups Projects
Verified Commit 5fe78632 authored by Bartek Jaskulski's avatar Bartek Jaskulski
Browse files

fix: refine issues with running cs

parent f9d2b969
No related branches found
No related tags found
1 merge request!6feat: rewrite CS rules
This commit is part of merge request !6. Comments created here will be created in the context of that merge request.
<?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 -->
......@@ -27,7 +28,6 @@
<!-- The only required comments are for the classes. -->
<exclude name="Squiz.Commenting.FunctionComment"/>
<exclude name="Squiz.Commenting.FileComment.Missing"/>
<exclude name="Generic.Commenting.DocComment.MissingShort"/>
<!-- You can use short if-else form. -->
......@@ -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
......
......@@ -15,9 +15,9 @@
"require": {
"php": ">=7.0",
"dealerdirect/phpcodesniffer-composer-installer": "0.6|^0.7",
"phpcompatibility/php-compatibility": "^9.3",
"squizlabs/php_codesniffer": "^3.6",
"wp-coding-standards/wpcs": "^2.3"
"wp-coding-standards/wpcs": "^2.3",
"phpcompatibility/phpcompatibility-wp": "^2.1.1"
},
"require-dev": {
"roave/security-advisories": "dev-latest"
......@@ -25,6 +25,9 @@
"scripts": {
"install-codestandards" : [
"Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin::run"
],
"post-install-cmd": [
"@install-codestandards"
]
}
}
......@@ -9,7 +9,8 @@
-->
<!-- Scan all files. -->
<file>.</file>
<file>./src</file>
<file>./templates</file>
<!-- Only check PHP files. -->
<arg name="extensions" value="php"/>
......@@ -20,8 +21,8 @@
<!-- Check up to 8 files simultaneously. -->
<arg name="parallel" value="8"/>
<!-- Cache the results between runs. -->
<arg name="cache" value="./.cache/phpcs.cache"/>
<!-- Cache outcomes for better performance. Remember to add the file to .gitignore. -->
<arg name="cache" value="./.phpcs-cache"/>
<!--
#############################################################################
......@@ -35,7 +36,7 @@
<!-- This value should be aligned with WordPress support version declared in plugin header -->
<config name="minimum_supported_wp_version" value="5.0"/>
<!-- WPDeskCS supports PHP 7.0 or higher. -->
<!-- Set value aligned with supported PHP Version for PHPCompatibilityWP check. -->
<config name="testVersion" value="7.0-"/>
<rule ref="WPDesk"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment