diff --git a/.gitignore b/.gitignore index 6f68bc7f65c25ceae8e856eb9ab25fa815acf0cd..63bb990a1793ee5ff8d6a300b46944b26f77b1d0 100755 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ .DS_Store -phpcs.xml phpunit.xml Thumbs.db wp-cli.local.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3df83ff447a04cfccfde7646ea6ac1e0cdcab296..a33e503860e122d1a2e58cb4e8a21742bd03af11 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -49,7 +49,7 @@ PHPunit:PHP5.3:MySQL: services: - mysql:5.6 script: - - phpcs + - phpcs -n - phpunit allow_failure: true @@ -58,7 +58,7 @@ PHPunit:PHP5.6:MySQL: services: - mysql:5.6 script: - - phpcs + - phpcs -n - phpunit PHPunit:PHP7.0:MySQL: @@ -66,7 +66,7 @@ PHPunit:PHP7.0:MySQL: services: - mysql:5.6 script: - - phpcs + - phpcs -n - phpunit PHPunit:PHP7.1:MySQL: @@ -74,7 +74,7 @@ PHPunit:PHP7.1:MySQL: services: - mysql:5.6 script: - - phpcs + - phpcs -n - phpunit PHPunit:PHP7.2:MySQL: @@ -82,5 +82,5 @@ PHPunit:PHP7.2:MySQL: services: - mysql:5.6 script: - - phpcs + - phpcs -n - phpunit diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 0000000000000000000000000000000000000000..4e25cc54973efb779494d6e92ec73a86183d7304 --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,39 @@ +<?xml version="1.0"?> +<ruleset name="WordPress Coding Standards for Plugins"> + <description>Generally-applicable sniffs for WordPress plugins</description> + + <!-- + Pass some flags to PHPCS: + p flag: Show progress of the run. + s flag: Show sniff codes in all reports. + --> + <arg value="ps" /> + + <!-- Strip the filepaths down to the relevant bit. --> + <arg name="basepath" value="./" /> + + <!-- Check up to 8 files simultaneously. --> + <arg name="parallel" value="8" /> + + <!-- Only check the PHP files. --> + <arg name="extensions" value="php" /> + + <!-- Check all files in this directory and the directories below it. --> + <file>.</file> + + <!-- Exclude a few directories and autogenerated files. --> + <exclude-pattern>*/node_modules/*</exclude-pattern> + <exclude-pattern>*/vendor/</exclude-pattern> + + <rule ref="WordPress" /> + <rule ref="WordPressVIPMinimum" /> + <!--<rule ref="WordPress-VIP-Go" />--> + + <config name="minimum_supported_wp_version" value="4.9" /> + + <rule ref="WordPress.NamingConventions.PrefixAllGlobals"> + <properties> + <property name="prefixes" type="array" value="camo" /> + </properties> + </rule> +</ruleset> diff --git a/phpcs.xml.dist b/phpcs.xml.dist deleted file mode 100644 index 4f1d0e5cf919397d4a3aff507b598e0075b9b047..0000000000000000000000000000000000000000 --- a/phpcs.xml.dist +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0"?> -<ruleset name="WordPress Coding Standards for Plugins"> - <description>Generally-applicable sniffs for WordPress plugins</description> - - <rule ref="WordPress-Core" /> - <rule ref="WordPress-Docs" /> - - <!-- Check all PHP files in directory tree by default. --> - <arg name="extensions" value="php"/> - <file>.</file> - - <!-- Show progress and sniff codes in all reports --> - <arg value="ps"/> - - <exclude-pattern>*/node_modules/*</exclude-pattern> - <exclude-pattern>*/vendor/*</exclude-pattern> -</ruleset>